bernova 1.2.1 → 1.2.2
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 -1
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.2] - 2026-01-16
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Fixed the css generated into js modules folder**: Prevent the copy of the css into js modules folders
|
|
13
|
+
- **Fixed the css minified name**: Fixed the minified css name
|
|
14
|
+
|
|
8
15
|
## [1.2.1] - 2026-01-15
|
|
9
16
|
|
|
10
17
|
### Fixed
|
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:
|
|
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:m,minifyJS:l,preventMoveJS:d,provider:v,type:y=""}){const b=r.name.endsWith(".d.ts"),D=s.resolve(m,r.path,r.name);if(!n(m,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(m,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)),l&&!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 m({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)(),m=s.resolve(c,p.path,p.name);if(n(c,m)){const a=await e.readFile(m,"utf8");await o(s.resolve(t,r,p.name),a,p.name.replace(".min",""))}}}function l({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,m=a&&!t;return o&&(y(e,{name:"cssVars.js",path:r}),m&&y(e,{name:"cssVars.d.ts",path:r})),n&&(y(e,{name:"cssClasses.js",path:r}),m&&y(e,{name:"cssClasses.d.ts",path:r})),i&&(y(e,{name:"cssMediaQueries.js",path:r}),m&&y(e,{name:"cssMediaQueries.d.ts",path:r})),c&&(y(e,{name:"cssGlobalStyles.js",path:r}),m&&y(e,{name:"cssGlobalStyles.d.ts",path:r})),p&&(y(e,{name:"cssAvailableComponents.js",path:r}),m&&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(),T=j??n??"",F=w??c??void 0,J=$??f??!1,P=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:P}),x=l({baseOutDir:T});if(k&&k.length>0&&await m({baseOutPath:x,cssFiles:k,rootDir:F,customOutDirs:L,dir:e}),q&&q.length>0)if(_&&Array.isArray(_)&&_.length>0)for(const s of _){const t=l({baseOutDir:T,type:s});for(const r of q)await p({baseOutPath:t,jsFile:r,rootDir:F,customOutDirs:L,dir:e,minifyJS:h,preventMoveJS:J,provider:a,type:s})}else for(const s of q)await p({baseOutPath:x,jsFile:s,rootDir:F,customOutDirs:L,dir:e,minifyJS:h,preventMoveJS:J,provider:a})})();
|