bernova 1.6.0 → 1.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Fix CI workflow and auto-release pipeline
8
+
9
+ ## 1.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Migrate from pnpm to Yarn Berry + add OxLint and OxFmt
14
+
15
+ ## 1.5.5
16
+
17
+ ### Patch Changes
18
+
19
+ - Delete the first dot in globalStyles names
20
+
21
+ Pull Request
22
+
3
23
  ## 1.5.4
4
24
 
5
25
  ### Patch Changes
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e=require("fs").promises,t=require("path"),s=require("@babel/core"),{minify:a}=require("terser"),{extractDocFragment:n,writeDoc:r,fileExists:o,readConfigData:i}=require("../src/lib");async function c({baseOutPath:s,jsFile:a,rootDir:i,customOutDirs:c,dir:l,minifyJS:m,preventMoveJS:d,provider:h,type:v="",embedCss:y,cssFiles:b}){const g=a.name.endsWith(".d.ts"),P=t.resolve(l,a.path,a.name);if(!o(l,P))return void console.error(`File not found: ${P}`);let j=await e.readFile(P,"utf8");const D=!!c?.css||y&&b.length>0;if("cssTheme.js"===a.name&&D){const s=j.replace("export default","").replaceAll(";","").trim(),a=new Function(`return (${s})`)();if(c?.css)j=`export default {\n${f({cssThemes:a,cssOutPath:c.css})}};\n`;else if(y&&b.length>0){const s=Object.keys(a)[0],n=b.find(e=>e.name===`${s}.css`||e.name===`${s}.min.css`);if(n){const{name:a,path:r}=n,i=t.resolve(l,r,a),c=o(l,i)?(await e.readFile(i,"utf8")).replace(/\s+/g,""):"",m={before:"",after:""};for(const a of b){const{name:n,path:r,parent:i}=a;if(i)for(const{name:a,position:c}of i)if(a===s){const s=t.resolve(l,r,n);if(o(l,s)){const t=(await e.readFile(s,"utf8")).replace(/\s+/g,"");m[c]+=t}}}const p=m.before+c+m.after;j=`export default {'${s}':{css:\`${p}\`}};`}}}if(a.name===`${h.name.toLocaleLowerCase()}.js`&&y&&b.length>0){const s="\n #linkBuilder = (css, id) => {\n if (typeof document === 'undefined') return;\n let styleElement = document.getElementById(id);\n if (!styleElement) {\n styleElement = document.createElement('style');\n styleElement.id = id;\n styleElement.type = 'text/css';\n document.head.appendChild(styleElement);\n }\n styleElement.innerHTML = css;\n };\n #handlerThemes = (data) => {\n const { css } = data;\n this.#linkBuilder(css, this.#linkId);\n };\n #cleanUpLinks = () => {\n if (typeof document === 'undefined') return;\n const style = document.getElementById(this.#linkId);\n if (style) style.remove();\n };\n ",a="../src/lib/generateProvider/template/providerTemplate.js";let r=await e.readFile(t.resolve(__dirname,a),"utf8");r=r.replace(/\$_Provider_\$/g,h.name);const o=n({section:"Bernova provider methods",doc:r});j=r.replace(o,s.trim())}if(a.name===`${h.name.toLocaleLowerCase()}.d.ts`&&y&&b.length>0){const s="\n #linkBuilder(css: string, id: string): void;\n #handlerThemes(data: { css: string }): void;\n #cleanUpLinks(): void;\n ",a="../src/lib/generateProvider/template/providerTemplate.d.ts";let r=await e.readFile(t.resolve(__dirname,a),"utf8");r=r.replace(/\$_Provider_\$/g,h.name);const o=n({section:"Bernova provider methods",doc:r});j=r.replace(o,s.trim())}"cjs"!==v||g||(j=await p(j,P,!0)),"esm"!==v||g||(j=await p(j,P)),m&&!g&&(j=await u(j));const C=t.relative(i||"",a.outPath),w=d?P:t.resolve(s,C,a.name);await r(w,j,a.name)}async function l({baseOutPath:s,cssFiles:a,rootDir:n,customOutDirs:i,dir:c}){for(const l of a){const a=(()=>n&&!i?.css?t.relative(n,l.path):i?.css?i.css:l.path)(),m=t.resolve(c,l.path,l.name);if(o(c,m)){const n=await e.readFile(m,"utf8"),o=l.name.replace(".min","");await r(t.resolve(s,a,o),n,o)}}}function m({baseOutDir:e,type:s="-"}){const a=(()=>{switch(s){case"cjs":return"cjs";case"esm":return"esm";default:return""}})();return t.join(e,a)}async function p(e,t,a=!1){const n=!!a&&"commonjs";return(await s.transformAsync(e,{filename:t,presets:[["@babel/preset-env",{modules:n,targets:{node:"current"}}]]})).code}async function u(e){return(await a(e,{compress:{dead_code:!0,drop_console:!1,drop_debugger:!0,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1},mangle:{toplevel:!1},format:{comments:!1}})).code}function d({themes:e,minifyCss:s}){return e&&Array.isArray(e)&&e.length>0?e.reduce((e,a)=>{const{name:n,stylesPath:r,foreignThemes:o}=a;return n&&r&&v(e,{name:s?`${n}.min.css`:`${n}.css`,path:r}),o&&Array.isArray(o)&&o.length>0&&o.forEach(s=>{const a=t.basename(s.path),r=s.path.replace(a,"").trim(),o=e.findIndex(e=>e.name===a&&e.path===r);o>=0?e[o].parent.push({name:n,position:s.position}):e.push({name:a,path:r,parent:[{name:n,position:s.position}]})}),e},[]):[]}async function h({dir:s,customOutDirs:a,provider:n,themes:r,preventMoveDTS:o=!1}){const i=r&&r.bvTools?r.reduce((e,{bvTools:t})=>{const{path:s,declarationHelp:n,cssVariables:r,cssClassNames:i,cssMediaQueries:c,cssGlobalStyles:l,availableComponents:m}=t,p=n&&!o,u=a?.tools?a.tools:s;return r&&(v(e,{name:"cssVars.js",path:s,outPath:u}),p&&v(e,{name:"cssVars.d.ts",path:s,outPath:u})),i&&(v(e,{name:"cssClasses.js",path:s,outPath:u}),p&&v(e,{name:"cssClasses.d.ts",path:s,outPath:u})),c&&(v(e,{name:"cssMediaQueries.js",path:s,outPath:u}),p&&v(e,{name:"cssMediaQueries.d.ts",path:s,outPath:u})),l&&(v(e,{name:"cssGlobalStyles.js",path:s,outPath:u}),p&&v(e,{name:"cssGlobalStyles.d.ts",path:s,outPath:u})),m&&(v(e,{name:"cssAvailableComponents.js",path:s,outPath:u}),p&&v(e,{name:"cssAvailableComponents.d.js",path:s,outPath:u})),e},[]):[];if(n){const r=`${n.name.toLocaleLowerCase()}.js`,c=a?.provider?a.provider:n.path;v(i,{name:r,path:n.path,outPath:c});const l=t.join(n.path,"stats"),m=a?.provider?t.join(a.provider,"stats"):l;v(i,{name:"stats.js",path:l,outPath:m});const p=t.resolve(s,l),u=await e.readdir(p,{withFileTypes:!0});if(u.forEach(e=>{if(e.isDirectory()){const s=t.join(l,e.name),a=t.join(m,e.name);v(i,{name:"cssAvailableComponents.js",path:s,outPath:a}),v(i,{name:"cssClassNames.js",path:s,outPath:a}),v(i,{name:"cssGlobalStyles.js",path:s,outPath:a}),v(i,{name:"cssMediaQueries.js",path:s,outPath:a}),v(i,{name:"cssTheme.js",path:s,outPath:a}),v(i,{name:"cssVars.js",path:s,outPath:a})}}),n.declarationHelp&&!o){const e=`${n.name.toLocaleLowerCase()}.d.ts`;v(i,{name:e,path:n.path,outPath:c}),v(i,{name:"stats.d.ts",path:l,outPath:m}),u.forEach(e=>{if(e.isDirectory()){const s=t.join(l,e.name),a=t.join(m,e.name);v(i,{name:"cssAvailableComponents.d.ts",path:s,outPath:a}),v(i,{name:"cssClassNames.d.ts",path:s,outPath:a}),v(i,{name:"cssGlobalStyles.d.ts",path:s,outPath:a}),v(i,{name:"cssMediaQueries.d.ts",path:s,outPath:a}),v(i,{name:"cssTheme.d.ts",path:s,outPath:a}),v(i,{name:"cssVars.d.ts",path:s,outPath:a})}})}}return i}function f({cssThemes:e,cssOutPath:s}){return Object.entries(e).reduce((e,[a,{foreign:n}])=>{const{before:r,after:o}=n,i=r&&Array.isArray(r)&&r.length>0?r.reduce((e,a,n)=>{const r=t.basename(a);return n>0&&(e+=", "),e+`'${s}/${r}'`},""):"",c=o&&Array.isArray(o)&&o.length>0?o.reduce((e,a,n)=>{const r=t.basename(a);return n>0&&(e+=", "),e+`'${s}/${r}'`},""):"";return e+`'${a}':{css:'${s}/${a}.css',foreign:{before: [${i}],after: [${c}]}}`},"")}function v(e,t){e.some(e=>e.name===t.name&&e.path===t.path)||e.push(t)}function y(){const e=["--base-out-dir","--root-dir","--prevent-process-js","--prevent-move-js","--prevent-move-dts","--types","--css","--tools","--provider","--embed-css"],t={};for(let s=0;s<process.argv.length;s++)if(e.includes(process.argv[s])){const a=process.argv[s].replace("--","").replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),n=process.argv[s+1];t[a]=(()=>!(n&&!e.includes(n))||("none"===n.toLocaleLowerCase()?"":n))()}return t}function b({jsonCustomOutDirs:e,cliCustomOutDirs:t}){let s={};return e&&(s={...e}),t&&(s={...s,...t}),Object.keys(s).length>0?s:void 0}(async()=>{const e=process.cwd(),s=await i(t.resolve(e,"bernova.config.json")),{compilerOptions:a,provider:n,themes:r}=s;a&&n&&r||(console.error("Invalid configuration: Missing compilerOptions, themes or provider"),process.exit(1));const{baseOutDir:o,rootDir:p,minifyCss:u,minifyJS:f,preventMoveJS:v,preventMoveDTS:g,types:P,embedCss:j,customOutDirs:D}=a,{baseOutDir:C,rootDir:w,types:O,preventMoveJs:$,preventMoveDts:F,preventProcessJs:T=!1,embedCss:A,...M}=y(),S=C??o??"",_=w??p??void 0,E=$??v??!1,k=F??g??!1,L=O??P??void 0,J=A??j??!1,x=b({jsonCustomOutDirs:D,cliCustomOutDirs:M}),B=d({themes:r,minifyCss:u}),I=T?[]:await h({dir:e,customOutDirs:x,provider:n,themes:r,preventMoveDTS:k}),q=m({baseOutDir:S});if(B&&B.length>0&&!J&&await l({baseOutPath:q,cssFiles:B,rootDir:_,customOutDirs:x,dir:e}),I&&I.length>0)if(L&&Array.isArray(L)&&L.length>0)for(const t of L){const s=m({baseOutDir:S,type:t});for(const a of I)await c({baseOutPath:s,jsFile:a,rootDir:_,customOutDirs:x,dir:e,minifyJS:f,preventMoveJS:E,provider:n,type:t,embedCss:J,cssFiles:B})}else for(const t of I)await c({baseOutPath:q,jsFile:t,rootDir:_,customOutDirs:x,dir:e,minifyJS:f,preventMoveJS:E,provider:n,embedCss:J,cssFiles:B})})();
2
+ const e=require("fs").promises,t=require("path"),s=require("@babel/core"),{minify:a}=require("terser"),{extractDocFragment:n,writeDoc:r,fileExists:o,readConfigData:i}=require("../src/lib");async function c({baseOutPath:s,jsFile:a,rootDir:i,customOutDirs:c,dir:l,minifyJS:m,preventMoveJS:d,provider:h={name:""},type:v="",embedCss:y,cssFiles:b}){const P=a.name.endsWith(".d.ts"),j=t.resolve(l,a.path,a.name);if(!o(l,j))return void console.error(`File not found: ${j}`);let D=await e.readFile(j,"utf8");const O=!!c?.css||y&&b.length>0;if("cssTheme.js"===a.name&&O){const s=D.replace("export default","").replaceAll(";","").trim(),a=new Function(`return (${s})`)();if(c?.css)D=`export default {\n${f({cssThemes:a,cssOutPath:c.css})}};\n`;else if(y&&b.length>0){const s=Object.keys(a)[0],n=b.find(e=>e.name===`${s}.css`||e.name===`${s}.min.css`);if(n){const{name:a,path:r}=n,i=t.resolve(l,r,a),c=o(l,i)?(await e.readFile(i,"utf8")).replace(/\s+/g,""):"",m={before:"",after:""};for(const a of b){const{name:n,path:r,parent:i}=a;if(i)for(const{name:a,position:c}of i)if(a===s){const s=t.resolve(l,r,n);if(o(l,s)){const t=(await e.readFile(s,"utf8")).replace(/\s+/g,"");m[c]+=t}}}const p=m.before+c+m.after;D=`export default {'${s}':{css:\`${p}\`}};`}}}if(a.name===`${g(h.name)}.js`&&y&&b.length>0){const s="\n #linkBuilder = (css, id) => {\n if (typeof document === 'undefined') return;\n let styleElement = document.getElementById(id);\n if (!styleElement) {\n styleElement = document.createElement('style');\n styleElement.id = id;\n styleElement.type = 'text/css';\n document.head.appendChild(styleElement);\n }\n styleElement.innerHTML = css;\n };\n #handlerThemes = (data) => {\n const { css } = data;\n this.#linkBuilder(css, this.#linkId);\n };\n #cleanUpLinks = () => {\n if (typeof document === 'undefined') return;\n const style = document.getElementById(this.#linkId);\n if (style) style.remove();\n };\n ",a="../src/lib/generateProvider/template/providerTemplate.js";let r=await e.readFile(t.resolve(__dirname,a),"utf8");r=r.replace(/\$_Provider_\$/g,h.name);const o=n({section:"Bernova provider methods",doc:r});D=r.replace(o,s.trim())}if(a.name===`${g(h.name)}.d.ts`&&y&&b.length>0){const s="\n #linkBuilder(css: string, id: string): void;\n #handlerThemes(data: { css: string }): void;\n #cleanUpLinks(): void;\n ",a="../src/lib/generateProvider/template/providerTemplate.d.ts";let r=await e.readFile(t.resolve(__dirname,a),"utf8");r=r.replace(/\$_Provider_\$/g,h.name);const o=n({section:"Bernova provider methods",doc:r});D=r.replace(o,s.trim())}"cjs"!==v||P||(D=await p(D,j,!0)),"esm"!==v||P||(D=await p(D,j)),m&&!P&&(D=await u(D));const C=t.relative(i||"",a.outPath),w=d?j:t.resolve(s,C,a.name);await r(w,D,a.name)}async function l({baseOutPath:s,cssFiles:a,rootDir:n,customOutDirs:i,dir:c}){for(const l of a){const a=(()=>n&&!i?.css?t.relative(n,l.path):i?.css?i.css:l.path)(),m=t.resolve(c,l.path,l.name);if(o(c,m)){const n=await e.readFile(m,"utf8"),o=l.name.replace(".min","");await r(t.resolve(s,a,o),n,o)}}}function m({baseOutDir:e,type:s="-"}){const a=(()=>{switch(s){case"cjs":return"cjs";case"esm":return"esm";default:return""}})();return t.join(e,a)}async function p(e,t,a=!1){const n=!!a&&"commonjs";return(await s.transformAsync(e,{filename:t,presets:[["@babel/preset-env",{modules:n,targets:{node:"current"}}]]})).code}async function u(e){return(await a(e,{compress:{dead_code:!0,drop_console:!1,drop_debugger:!0,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1},mangle:{toplevel:!1},format:{comments:!1}})).code}function d({themes:e,minifyCss:s}){return e&&Array.isArray(e)&&e.length>0?e.reduce((e,a)=>{const{name:n,stylesPath:r,foreignThemes:o}=a;return n&&r&&v(e,{name:s?`${n}.min.css`:`${n}.css`,path:r}),o&&Array.isArray(o)&&o.length>0&&o.forEach(s=>{const a=t.basename(s.path),r=s.path.replace(a,"").trim(),o=e.findIndex(e=>e.name===a&&e.path===r);o>=0?e[o].parent.push({name:n,position:s.position}):e.push({name:a,path:r,parent:[{name:n,position:s.position}]})}),e},[]):[]}async function h({dir:s,customOutDirs:a,provider:n,themes:r,preventMoveDTS:o=!1}){const i=r&&r.bvTools?r.reduce((e,{bvTools:t})=>{const{path:s,declarationHelp:n,cssVariables:r,cssClassNames:i,cssMediaQueries:c,cssGlobalStyles:l,availableComponents:m}=t,p=n&&!o,u=a?.tools?a.tools:s;return r&&(v(e,{name:"cssVars.js",path:s,outPath:u}),p&&v(e,{name:"cssVars.d.ts",path:s,outPath:u})),i&&(v(e,{name:"cssClasses.js",path:s,outPath:u}),p&&v(e,{name:"cssClasses.d.ts",path:s,outPath:u})),c&&(v(e,{name:"cssMediaQueries.js",path:s,outPath:u}),p&&v(e,{name:"cssMediaQueries.d.ts",path:s,outPath:u})),l&&(v(e,{name:"cssGlobalStyles.js",path:s,outPath:u}),p&&v(e,{name:"cssGlobalStyles.d.ts",path:s,outPath:u})),m&&(v(e,{name:"cssAvailableComponents.js",path:s,outPath:u}),p&&v(e,{name:"cssAvailableComponents.d.js",path:s,outPath:u})),e},[]):[];if(n){const r=g(n.name),c=`${r}.js`,l=a?.provider?a.provider:n.path;v(i,{name:c,path:n.path,outPath:l});const m=t.join(n.path,"stats"),p=a?.provider?t.join(a.provider,"stats"):m;v(i,{name:"stats.js",path:m,outPath:p});const u=t.resolve(s,m),d=await e.readdir(u,{withFileTypes:!0});d.forEach(e=>{if(e.isDirectory()){const s=t.join(m,e.name),a=t.join(p,e.name);v(i,{name:"cssAvailableComponents.js",path:s,outPath:a}),v(i,{name:"cssClassNames.js",path:s,outPath:a}),v(i,{name:"cssGlobalStyles.js",path:s,outPath:a}),v(i,{name:"cssMediaQueries.js",path:s,outPath:a}),v(i,{name:"cssTheme.js",path:s,outPath:a}),v(i,{name:"cssVars.js",path:s,outPath:a})}}),n.declarationHelp&&!o&&(v(i,{name:`${r}.d.ts`,path:n.path,outPath:l}),v(i,{name:"stats.d.ts",path:m,outPath:p}),d.forEach(e=>{if(e.isDirectory()){const s=t.join(m,e.name),a=t.join(p,e.name);v(i,{name:"cssAvailableComponents.d.ts",path:s,outPath:a}),v(i,{name:"cssClassNames.d.ts",path:s,outPath:a}),v(i,{name:"cssGlobalStyles.d.ts",path:s,outPath:a}),v(i,{name:"cssMediaQueries.d.ts",path:s,outPath:a}),v(i,{name:"cssTheme.d.ts",path:s,outPath:a}),v(i,{name:"cssVars.d.ts",path:s,outPath:a})}}))}return i}function f({cssThemes:e,cssOutPath:s}){return Object.entries(e).reduce((e,[a,{foreign:n}])=>{const{before:r,after:o}=n,i=r&&Array.isArray(r)&&r.length>0?r.reduce((e,a,n)=>{const r=t.basename(a);return n>0&&(e+=", "),e+`'${s}/${r}'`},""):"",c=o&&Array.isArray(o)&&o.length>0?o.reduce((e,a,n)=>{const r=t.basename(a);return n>0&&(e+=", "),e+`'${s}/${r}'`},""):"";return e+`'${a}':{css:'${s}/${a}.css',foreign:{before: [${i}],after: [${c}]}}`},"")}function v(e,t){e.some(e=>e.name===t.name&&e.path===t.path)||e.push(t)}function y(){const e=["--base-out-dir","--root-dir","--prevent-process-js","--prevent-move-js","--prevent-move-dts","--types","--css","--tools","--provider","--embed-css"],t={};for(let s=0;s<process.argv.length;s++)if(e.includes(process.argv[s])){const a=process.argv[s].replace("--","").replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),n=process.argv[s+1];t[a]=(()=>!(n&&!e.includes(n))||("none"===n.toLocaleLowerCase()?"":n))()}return t}function b({jsonCustomOutDirs:e,cliCustomOutDirs:t}){let s={};return e&&(s={...e}),t&&(s={...s,...t}),Object.keys(s).length>0?s:void 0}function g(e="provider"){return e.charAt(0).toLowerCase()+e.slice(1)}(async()=>{const e=process.cwd(),s=await i(t.resolve(e,"bernova.config.json")),{compilerOptions:a,provider:n,themes:r}=s;a&&n&&r||(console.error("Invalid configuration: Missing compilerOptions, themes or provider"),process.exit(1));const{baseOutDir:o,rootDir:p,minifyCss:u,minifyJS:f,preventMoveJS:v,preventMoveDTS:g,types:P,embedCss:j,customOutDirs:D}=a,{baseOutDir:O,rootDir:C,types:w,preventMoveJs:$,preventMoveDts:F,preventProcessJs:A=!1,embedCss:T,...M}=y(),S=O??o??"",_=C??p??void 0,E=$??v??!1,k=F??g??!1,J=w??P??void 0,x=T??j??!1,B=b({jsonCustomOutDirs:D,cliCustomOutDirs:M}),I=d({themes:r,minifyCss:u}),L=A?[]:await h({dir:e,customOutDirs:B,provider:n,themes:r,preventMoveDTS:k}),q=m({baseOutDir:S});if(I&&I.length>0&&!x&&await l({baseOutPath:q,cssFiles:I,rootDir:_,customOutDirs:B,dir:e}),L&&L.length>0)if(J&&Array.isArray(J)&&J.length>0)for(const t of J){const s=m({baseOutDir:S,type:t});for(const a of L)await c({baseOutPath:s,jsFile:a,rootDir:_,customOutDirs:B,dir:e,minifyJS:f,preventMoveJS:E,provider:n,type:t,embedCss:x,cssFiles:I})}else for(const t of L)await c({baseOutPath:q,jsFile:t,rootDir:_,customOutDirs:B,dir:e,minifyJS:f,preventMoveJS:E,provider:n,embedCss:x,cssFiles:I})})();
File without changes
@@ -1 +1 @@
1
- const{simplifyName:e}=require("../../../simplifyName/simplifyName.utils.js"),{extractValues:l}=require("../utils/extractValues.utils.js"),s=s=>s.reduce((s,{targets:t,styles:a})=>{const o=l({styles:a});s.globalStyles+=`${t} { ${o} }\n`;const r=t.split(" ").filter(e=>e.startsWith("."));return r.length&&r.forEach(l=>{const t=e(l);s.globalDocs.doc+=` ${t}: '${l}',\n`,s.globalDocs.declare+=` ${t}: string;\n`}),s},{globalStyles:"",globalDocs:{doc:"",declare:""}});module.exports={generateGlobalStyles:s};
1
+ const{simplifyName:e}=require("../../../simplifyName/simplifyName.utils.js"),{extractValues:l}=require("../utils/extractValues.utils.js"),s=s=>s.reduce((s,{targets:t,styles:a})=>{const r=l({styles:a});s.globalStyles+=`${t} { ${r} }\n`;const o=t.split(" ").filter(e=>e.startsWith("."));return o.length&&o.forEach(l=>{const t=e(l);s.globalDocs.doc+=` ${t}: '${l.replace(".","")}',\n`,s.globalDocs.declare+=` ${t}: string;\n`}),s},{globalStyles:"",globalDocs:{doc:"",declare:""}});module.exports={generateGlobalStyles:s};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bernova",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "The best way to write CSS with Javascript syntax",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "bin": {
18
18
  "bernova": "./dist/bin/bernova.js",
19
- "bv-config": "./dist/bin/createConfigFile.js",
20
- "bv-build": "./dist/bin/buildstyle.js"
19
+ "bv-build": "./dist/bin/buildstyle.js",
20
+ "bv-config": "./dist/bin/createConfigFile.js"
21
21
  },
22
22
  "_moduleAliases": {
23
23
  "@": "src"
@@ -30,6 +30,45 @@
30
30
  "CHANGELOG.md",
31
31
  "LICENSE"
32
32
  ],
33
+ "scripts": {
34
+ "dist": "yarn build",
35
+ "build": "yarn clean && yarn build:types && yarn build:vite && yarn build:copy",
36
+ "build:vite": "vite build",
37
+ "build:types": "tsc --declaration --emitDeclarationOnly --outDir types",
38
+ "build:copy-interfaces": "cp -r interfaces dist/interfaces && echo 'bernova components interfaces copied'",
39
+ "build:copy": "yarn build:copy-src && yarn build:copy-interfaces && yarn build:copy-bin && yarn build:optimize",
40
+ "build:copy-src": "cp -r src dist/ && echo 'Source files copied for compatibility'",
41
+ "build:copy-bin": "mkdir -p dist/bin && cp -r bin/* dist/bin/ && chmod +x dist/bin/*.js && echo 'CLI binaries copied and made executable'",
42
+ "build:optimize": "yarn build:remove-tests && yarn build:remove-docs && yarn build:minify-cli",
43
+ "build:remove-tests": "find dist/src -name '__tests__' -type d -exec rm -rf {} + 2>/dev/null || true && find dist/src -name '*.test.js' -delete 2>/dev/null || true && echo 'Test files removed from build'",
44
+ "build:remove-docs": "find dist/src -name '*.md' -delete 2>/dev/null || true && echo 'Documentation files removed from build'",
45
+ "build:minify-cli": "node scripts/minify-all.js",
46
+ "start": "node ./bin/bernova.js",
47
+ "start:foundation": "node ./bin/bernova.js --foundation-only",
48
+ "start:component": "node ./bin/bernova.js --component-only",
49
+ "dev": "yarn start",
50
+ "config": "node ./bin/createConfigFile.js",
51
+ "typing": "node ./bin/declareCssType.js",
52
+ "prepublishOnly": "yarn build",
53
+ "test": "vitest --coverage.enabled=true --silent --run",
54
+ "test:watch": "vitest",
55
+ "test:ui": "vitest --ui",
56
+ "test:coverage": "vitest run --coverage",
57
+ "test:ci": "vitest --coverage.enabled=true --silent --run ",
58
+ "clean": "rm -rf dist types",
59
+ "postinstall": "echo 'postinstall'",
60
+ "changeset": "changeset",
61
+ "changeset:version": "changeset version",
62
+ "changeset:publish": "changeset publish",
63
+ "changeset:status": "changeset status --verbose",
64
+ "lint": "oxlint src",
65
+ "lint:fix": "oxlint src --fix",
66
+ "format": "oxfmt src bin",
67
+ "format:check": "oxfmt --check src bin",
68
+ "typecheck": "tsc --noEmit",
69
+ "validate": "yarn format:check && yarn lint && yarn typecheck && yarn dist",
70
+ "validate:quick": "yarn lint && yarn typecheck"
71
+ },
33
72
  "keywords": [
34
73
  "css",
35
74
  "css-in-js",
@@ -66,26 +105,26 @@
66
105
  "url": "https://github.com/sponsors/kubit-ui"
67
106
  },
68
107
  "engines": {
69
- "node": ">=20.0.0",
70
- "pnpm": ">=10.0.0"
108
+ "node": ">=20.0.0 <25.0.0",
109
+ "yarn": ">=4.0.0"
71
110
  },
72
111
  "publishConfig": {
73
112
  "access": "public",
74
113
  "registry": "https://registry.npmjs.org/"
75
114
  },
76
115
  "dependencies": {
116
+ "@babel/core": "^7.28.5",
117
+ "@babel/preset-env": "^7.28.5",
77
118
  "autoprefixer": "^10.4.21",
78
119
  "cssnano": "^7.1.1",
79
120
  "ora": "^9.0.0",
80
121
  "postcss": "^8.5.6",
81
122
  "postcss-font-magician": "^4.0.0",
82
123
  "postcss-preset-env": "^10.4.0",
83
- "ts-node": "^10.9.2",
84
- "typescript": "*",
85
124
  "terser": "^5.44.1",
125
+ "ts-node": "^10.9.2",
86
126
  "tsconfig-paths": "^4.2.0",
87
- "@babel/core": "^7.28.5",
88
- "@babel/preset-env": "^7.28.5"
127
+ "typescript": "*"
89
128
  },
90
129
  "devDependencies": {
91
130
  "@babel/cli": "^7.28.3",
@@ -96,41 +135,13 @@
96
135
  "glob": "^11.0.0",
97
136
  "jsdom": "^26.1.0",
98
137
  "module-alias": "^2.2.3",
138
+ "oxfmt": "^0.41.0",
139
+ "oxlint": "^1.56.0",
99
140
  "postcss-combine-media-query": "^2.1.0",
100
141
  "rollup-plugin-copy": "^3.5.0",
101
142
  "vite": "^6.3.6",
102
143
  "vite-plugin-dts": "^4.5.0",
103
144
  "vitest": "^3.2.4"
104
145
  },
105
- "scripts": {
106
- "dist": "pnpm run build",
107
- "build": "pnpm run clean && pnpm run build:types && pnpm run build:vite && pnpm run build:copy",
108
- "build:vite": "vite build",
109
- "build:types": "tsc --declaration --emitDeclarationOnly --outDir types",
110
- "build:copy-interfaces": "cp -r interfaces dist/interfaces && echo 'bernova components interfaces copied'",
111
- "build:copy": "pnpm run build:copy-src && pnpm run build:copy-interfaces && pnpm run build:copy-bin && pnpm run build:optimize",
112
- "build:copy-src": "cp -r src dist/ && echo 'Source files copied for compatibility'",
113
- "build:copy-bin": "mkdir -p dist/bin && cp -r bin/* dist/bin/ && chmod +x dist/bin/*.js && echo 'CLI binaries copied and made executable'",
114
- "build:optimize": "pnpm run build:remove-tests && pnpm run build:remove-docs && pnpm run build:minify-cli",
115
- "build:remove-tests": "find dist/src -name '__tests__' -type d -exec rm -rf {} + 2>/dev/null || true && find dist/src -name '*.test.js' -delete 2>/dev/null || true && echo 'Test files removed from build'",
116
- "build:remove-docs": "find dist/src -name '*.md' -delete 2>/dev/null || true && echo 'Documentation files removed from build'",
117
- "build:minify-cli": "node scripts/minify-all.js",
118
- "start": "node ./bin/bernova.js",
119
- "start:foundation": "node ./bin/bernova.js --foundation-only",
120
- "start:component": "node ./bin/bernova.js --component-only",
121
- "dev": "pnpm run start",
122
- "config": "node ./bin/createConfigFile.js",
123
- "typing": "node ./bin/declareCssType.js",
124
- "test": "pnpm run vitest --coverage.enabled=true --silent --run ",
125
- "test:watch": "vitest",
126
- "test:ui": "vitest --ui",
127
- "test:coverage": "vitest run --coverage",
128
- "test:ci": "vitest --coverage.enabled=true --silent --run ",
129
- "clean": "rm -rf dist types",
130
- "postinstall": "echo 'postinstall'",
131
- "changeset": "changeset",
132
- "changeset:version": "changeset version",
133
- "changeset:publish": "changeset publish",
134
- "changeset:status": "changeset status --verbose"
135
- }
136
- }
146
+ "packageManager": "yarn@4.9.1"
147
+ }
@@ -17,7 +17,7 @@ const generateGlobalStyles = (globalStyles) => {
17
17
  if (allTargets.length) {
18
18
  allTargets.forEach((target) => {
19
19
  const formattedTarget = simplifyName(target);
20
- acc.globalDocs.doc += ` ${formattedTarget}: '${target}',\n`;
20
+ acc.globalDocs.doc += ` ${formattedTarget}: '${target.replace('.', '')}',\n`;
21
21
  acc.globalDocs.declare += ` ${formattedTarget}: string;\n`;
22
22
  });
23
23
  }
@@ -1,9 +0,0 @@
1
- /* === BERNOVA FOUNDATIONS === */
2
- :root{
3
- }
4
-
5
- /* === END FOUNDATIONS === */
6
-
7
- /* === BERNOVA COMPONENTS === */
8
-
9
- /* === END COMPONENTS === */
File without changes
@@ -1,9 +0,0 @@
1
- /* === BERNOVA FOUNDATIONS === */
2
- :root{
3
- }
4
-
5
- /* === END FOUNDATIONS === */
6
-
7
- /* === BERNOVA COMPONENTS === */
8
-
9
- /* === END COMPONENTS === */
File without changes
File without changes
@@ -1,9 +0,0 @@
1
- /* === BERNOVA FOUNDATIONS === */
2
- :root{
3
- }
4
-
5
- /* === END FOUNDATIONS === */
6
-
7
- /* === BERNOVA COMPONENTS === */
8
-
9
- /* === END COMPONENTS === */
File without changes