bernova 1.2.0 → 1.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/CHANGELOG.md +7 -0
- package/dist/bin/buildstyle.js +1 -1
- package/package.json +1 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to Bernova will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.1] - 2026-01-15
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Fixed the dependencies**: Fixed the package.json dependencies types
|
|
13
|
+
- **Fixed the css custom output dir**: Fixed the custom css output dir
|
|
14
|
+
|
|
8
15
|
## [1.2.0] - 2026-01-14
|
|
9
16
|
|
|
10
17
|
### New Features
|
package/dist/bin/buildstyle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const e=require("fs").promises,s=require("path"),t=require("@babel/core"),{minify:r}=require("terser"),{extractDocFragment:a,writeDoc:o,fileExists:n,readConfigData:i,buildRelativePath:c}=require("../src/lib");async function p({baseOutPath:t,jsFile:r,rootDir:i,customOutDirs:p,dir:l,minifyJS:m,preventMoveJS:d,provider:v,type:y=""}){const b=r.name.endsWith(".d.ts"),D=s.resolve(l,r.path,r.name);if(!n(l,D))return void console.error(`File not found: ${D}`);let g=await e.readFile(D,"utf8");if("stats.js"===r.name&&p?.css){const e=a({section:"CssThemes",doc:g}),t=e.replace(/export const cssThemes\s*=\s*/,""),r=new Function(`return (${t})`)(),o=s.relative(i||"",v.path),n=f({cssThemes:r,cssOutPath:c({from:s.resolve(o),to:s.resolve(l,p.css)})});g=g.replace(e,`export const cssThemes = {\n${n}};\n`)}"cjs"!==y||b||(g=await u(g,D,!0)),"esm"!==y||b||(g=await u(g,D)),m&&!b&&(g=await h(g));const O=s.relative(i||"",r.path),j=d?D:s.resolve(t,O,r.name);await o(j,g,r.name)}async function l({baseOutPath:t,cssFiles:r,rootDir:a,customOutDirs:i,dir:c}){for(const p of r){const r=(()=>a
|
|
2
|
+
const e=require("fs").promises,s=require("path"),t=require("@babel/core"),{minify:r}=require("terser"),{extractDocFragment:a,writeDoc:o,fileExists:n,readConfigData:i,buildRelativePath:c}=require("../src/lib");async function p({baseOutPath:t,jsFile:r,rootDir:i,customOutDirs:p,dir:l,minifyJS:m,preventMoveJS:d,provider:v,type:y=""}){const b=r.name.endsWith(".d.ts"),D=s.resolve(l,r.path,r.name);if(!n(l,D))return void console.error(`File not found: ${D}`);let g=await e.readFile(D,"utf8");if("stats.js"===r.name&&p?.css){const e=a({section:"CssThemes",doc:g}),t=e.replace(/export const cssThemes\s*=\s*/,""),r=new Function(`return (${t})`)(),o=s.relative(i||"",v.path),n=f({cssThemes:r,cssOutPath:c({from:s.resolve(o),to:s.resolve(l,p.css)})});g=g.replace(e,`export const cssThemes = {\n${n}};\n`)}"cjs"!==y||b||(g=await u(g,D,!0)),"esm"!==y||b||(g=await u(g,D)),m&&!b&&(g=await h(g));const O=s.relative(i||"",r.path),j=d?D:s.resolve(t,O,r.name);await o(j,g,r.name)}async function l({baseOutPath:t,cssFiles:r,rootDir:a,customOutDirs:i,dir:c}){for(const p of r){const r=(()=>a&&!i?.css?s.relative(a,p.path):i?.css?i.css:p.path)(),l=s.resolve(c,p.path,p.name);if(n(c,l)){const a=await e.readFile(l,"utf8");await o(s.resolve(t,r,p.name),a,p.name)}}}function m({baseOutDir:e,type:t="-"}){const r=(()=>{switch(t){case"cjs":return"cjs";case"esm":return"esm";default:return""}})();return s.join(e,r)}async function u(e,s,r=!1){const a=!!r&&"commonjs";return(await t.transformAsync(e,{filename:s,presets:[["@babel/preset-env",{modules:a,targets:{node:"current"}}]]})).code}async function h(e){return(await r(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:t}){return e&&Array.isArray(e)&&e.length>0?e.reduce((e,r)=>{const{name:a,stylesPath:o,foreignThemes:n}=r;return a&&o&&y(e,{name:t?`${a}.min.css`:`${a}.css`,path:o}),n&&Array.isArray(n)&&n.length>0&&n.forEach(t=>{const r=s.basename(t),a=t.replace(r,"").trim();y(e,{name:r,path:a})}),e},[]):[]}function v({provider:e,themes:s,preventMoveDTS:t=!1}){const r=s&&s.bvTools?s.reduce((e,{bvTools:s})=>{const{path:r,declarationHelp:a,cssVariables:o,cssClassNames:n,cssMediaQueries:i,cssGlobalStyles:c,availableComponents:p}=s,l=a&&!t;return o&&(y(e,{name:"cssVars.js",path:r}),l&&y(e,{name:"cssVars.d.ts",path:r})),n&&(y(e,{name:"cssClasses.js",path:r}),l&&y(e,{name:"cssClasses.d.ts",path:r})),i&&(y(e,{name:"cssMediaQueries.js",path:r}),l&&y(e,{name:"cssMediaQueries.d.ts",path:r})),c&&(y(e,{name:"cssGlobalStyles.js",path:r}),l&&y(e,{name:"cssGlobalStyles.d.ts",path:r})),p&&(y(e,{name:"cssAvailableComponents.js",path:r}),l&&y(e,{name:"cssAvailableComponents.d.js",path:r})),e},[]):[];return e&&(y(r,{name:`${e.name.toLocaleLowerCase()}.js`,path:e.path}),y(r,{name:"stats.js",path:`${e.path}/stats`}),e.declarationHelp&&!t&&(y(r,{name:`${e.name.toLocaleLowerCase()}.d.ts`,path:e.path}),y(r,{name:"stats.d.ts",path:`${e.path}/stats`}))),r}function f({cssThemes:e,cssOutPath:t}){return Object.entries(e).reduce((e,[r,{foreign:a}])=>{const{before:o,after:n}=a,i=o&&Array.isArray(o)&&o.length>0?o.reduce((e,r,a)=>{const o=s.basename(r);return a>0&&(e+=", "),e+`'${t}/${o}'`},""):"",c=n&&Array.isArray(n)&&n.length>0?n.reduce((e,r,a)=>{const o=s.basename(r);return a>0&&(e+=", "),e+`'${t}/${o}'`},""):"";return e+`'${r}': { css: '${t}/${r}.css', foreign: { before: [${i}], after: [${c}] } },\n`},"")}function y(e,s){e.some(e=>e.name===s.name&&e.path===s.path)||e.push(s)}function b(){const e=["--base-out-dir","--root-dir","--prevent-process-js","--prevent-move-js","--prevent-move-dts","--types","--css","--tools","--provider"],s={};for(let t=0;t<process.argv.length;t++)if(e.includes(process.argv[t])){const r=process.argv[t].replace("--","").replace(/-([a-z])/g,(e,s)=>s.toUpperCase()),a=process.argv[t+1];s[r]=(()=>!(a&&!e.includes(a))||("none"===a.toLocaleLowerCase()?"":a))()}return s}function D({jsonCustomOutDirs:e,cliCustomOutDirs:s}){let t={};return e&&(t={...e}),s&&(t={...t,...s}),Object.keys(t).length>0?t:void 0}(async()=>{const e=process.cwd(),t=await i(s.resolve(e,"bernova.config.json")),{compilerOptions:r,provider:a,themes:o}=t;r&&a&&o||(console.error("Invalid configuration: Missing compilerOptions, themes or provider"),process.exit(1));const{baseOutDir:n,rootDir:c,minifyCss:u,minifyJS:h,preventMoveJS:f,preventMoveDTS:y,types:g,customOutDirs:O}=r,{baseOutDir:j,rootDir:w,types:C,preventMoveJs:$,preventMoveDts:S,preventProcessJs:A=!1,...M}=b(),F=j??n??"",P=w??c??void 0,T=$??f??!1,J=S??y??!1,_=C??g??void 0,L=D({jsonCustomOutDirs:O,cliCustomOutDirs:M}),k=d({themes:o,minifyCss:u}),q=A?[]:v({provider:a,themes:o,preventMoveDTS:J});if(_&&Array.isArray(_)&&_.length>0)for(const s of _){const t=m({baseOutDir:F,type:s});if(k&&k.length>0&&await l({baseOutPath:t,cssFiles:k,rootDir:P,customOutDirs:L,dir:e}),q&&q.length>0)for(const r of q)await p({baseOutPath:t,jsFile:r,rootDir:P,customOutDirs:L,dir:e,minifyJS:h,preventMoveJS:T,provider:a,type:s})}else{const s=m({baseOutDir:F});if(k&&k.length>0&&await l({baseOutPath:s,cssFiles:k,rootDir:P,customOutDirs:L,dir:e}),q&&q.length>0)for(const t of q)await p({baseOutPath:s,jsFile:t,rootDir:P,customOutDirs:L,dir:e,minifyJS:h,preventMoveJS:T,provider:a})}})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bernova",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
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",
|
|
@@ -86,8 +86,6 @@
|
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@babel/cli": "^7.28.3",
|
|
89
|
-
"@babel/core": "^7.28.4",
|
|
90
|
-
"@babel/preset-env": "^7.28.3",
|
|
91
89
|
"@vitejs/plugin-legacy": "^6.1.1",
|
|
92
90
|
"@vitest/coverage-v8": "3.2.4",
|
|
93
91
|
"@vitest/ui": "^3.2.4",
|
|
@@ -96,8 +94,6 @@
|
|
|
96
94
|
"module-alias": "^2.2.3",
|
|
97
95
|
"postcss-combine-media-query": "^2.1.0",
|
|
98
96
|
"rollup-plugin-copy": "^3.5.0",
|
|
99
|
-
"terser": "^5.44.0",
|
|
100
|
-
"tsconfig-paths": "^4.2.0",
|
|
101
97
|
"vite": "^6.3.6",
|
|
102
98
|
"vite-plugin-dts": "^4.5.0",
|
|
103
99
|
"vitest": "^3.2.4"
|