bernova 1.0.0 → 1.0.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 +11 -0
- package/README.md +16 -0
- package/dist/bin/buildstyle.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ 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.0.1] - 2026-01-12
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Semantic problem solved**: change target for targets
|
|
13
|
+
|
|
14
|
+
### Documentatation
|
|
15
|
+
|
|
16
|
+
- **Added the bernova build script example**: Added the bv-build example.
|
|
17
|
+
- **Added the instalation examples with anothers packages manager**: Added examples for `'npm'` and `'yarn`
|
|
18
|
+
|
|
8
19
|
## [1.0.0] - 2026-01-08
|
|
9
20
|
|
|
10
21
|
### New Features
|
package/README.md
CHANGED
|
@@ -51,10 +51,20 @@
|
|
|
51
51
|
- [Multi themes](#using-multi-themes)
|
|
52
52
|
- [Provider](#library-provider)
|
|
53
53
|
- [Foreign CSS documents](#foreign-css-documents)
|
|
54
|
+
- [Compiler Options](#compiler-options)
|
|
54
55
|
|
|
55
56
|
## Installation
|
|
56
57
|
|
|
58
|
+
You can install Bernova using your preferred package manager:
|
|
59
|
+
|
|
57
60
|
```bash
|
|
61
|
+
# Using npm
|
|
62
|
+
npm install bernova
|
|
63
|
+
|
|
64
|
+
# Using yarn
|
|
65
|
+
yarn add bernova
|
|
66
|
+
|
|
67
|
+
# Using pnpm (recommended)
|
|
58
68
|
pnpm add bernova
|
|
59
69
|
```
|
|
60
70
|
|
|
@@ -1791,6 +1801,12 @@ export const LOGIN_BUTTON = {
|
|
|
1791
1801
|
|
|
1792
1802
|
## Compiler Options
|
|
1793
1803
|
|
|
1804
|
+
There is a script provided by the library to generate a build/dist bundler is:
|
|
1805
|
+
|
|
1806
|
+
```bash
|
|
1807
|
+
npx bv-build
|
|
1808
|
+
```
|
|
1809
|
+
|
|
1794
1810
|
When publishing our projects, depending of the packager configuration, it is necessary to move static files or other types of documents not originalle included. Bernova manages the files necessary for proper operation in production.
|
|
1795
1811
|
|
|
1796
1812
|
```json
|
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:a}=require("terser"),{extractDocFragment:r,writeDoc:n,fileExists:o,readConfigData:i,buildRelativePath:c}=require("../src/lib");async function m({baseOutPath:t,jsFile:a,rootDir:i,customOutDirs:m,dir:l,minifyJS:p,preventMoveJS:f,provider:d,type:y=""}){const b=s.resolve(l,a.path,a.name);if(!o(l,b))return void console.error(`File not found: ${b}`);let D=await e.readFile(b,"utf8");if("stats.js"===a.name&&m?.css){const e=r({section:"CssThemes",doc:D}),t=e.replace(/export const cssThemes\s*=\s*/,""),a=new Function(`return (${t})`)(),n=s.relative(i||"",d.path),o=v({cssThemes:a,cssOutPath:c({from:s.resolve(n),to:s.resolve(l,m.css)})});D=D.replace(e,`export const cssThemes = {\n${o}};\n`)}"cjs"===y&&(D=await u(D,b,!0)),"esm"===y&&(D=await u(D,b)),p&&(D=await h(D));const O=s.relative(i||"",a.path),g=f?b:s.resolve(t,O,a.name);await n(g,D,a.name)}async function l({baseOutPath:t,cssFiles:a,rootDir:r,customOutDirs:i,dir:c}){for(const m of a){const a=(()=>r&&i?.css?s.relative(r,m.path):i?.css?i.css:m.path)(),l=s.resolve(c,m.path,m.name);if(o(c,l)){const r=await e.readFile(l,"utf8");await n(s.resolve(t,a,m.name),r,m.name)}}}function p({baseOutDir:e,type:t="-"}){const a=(()=>{switch(t){case"cjs":return"cjs";case"esm":return"esm";default:return""}})();return s.join(e,a)}async function u(e,s,a=!1){const r=!!a&&"commonjs";return(await t.transformAsync(e,{filename:s,presets:[["@babel/preset-env",{modules:r,
|
|
2
|
+
const e=require("fs").promises,s=require("path"),t=require("@babel/core"),{minify:a}=require("terser"),{extractDocFragment:r,writeDoc:n,fileExists:o,readConfigData:i,buildRelativePath:c}=require("../src/lib");async function m({baseOutPath:t,jsFile:a,rootDir:i,customOutDirs:m,dir:l,minifyJS:p,preventMoveJS:f,provider:d,type:y=""}){const b=s.resolve(l,a.path,a.name);if(!o(l,b))return void console.error(`File not found: ${b}`);let D=await e.readFile(b,"utf8");if("stats.js"===a.name&&m?.css){const e=r({section:"CssThemes",doc:D}),t=e.replace(/export const cssThemes\s*=\s*/,""),a=new Function(`return (${t})`)(),n=s.relative(i||"",d.path),o=v({cssThemes:a,cssOutPath:c({from:s.resolve(n),to:s.resolve(l,m.css)})});D=D.replace(e,`export const cssThemes = {\n${o}};\n`)}"cjs"===y&&(D=await u(D,b,!0)),"esm"===y&&(D=await u(D,b)),p&&(D=await h(D));const O=s.relative(i||"",a.path),g=f?b:s.resolve(t,O,a.name);await n(g,D,a.name)}async function l({baseOutPath:t,cssFiles:a,rootDir:r,customOutDirs:i,dir:c}){for(const m of a){const a=(()=>r&&i?.css?s.relative(r,m.path):i?.css?i.css:m.path)(),l=s.resolve(c,m.path,m.name);if(o(c,l)){const r=await e.readFile(l,"utf8");await n(s.resolve(t,a,m.name),r,m.name)}}}function p({baseOutDir:e,type:t="-"}){const a=(()=>{switch(t){case"cjs":return"cjs";case"esm":return"esm";default:return""}})();return s.join(e,a)}async function u(e,s,a=!1){const r=!!a&&"commonjs";return(await t.transformAsync(e,{filename:s,presets:[["@babel/preset-env",{modules:r,targets:{node:"current"}}]]})).code}async function h(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 f({themes:e,minifyCss:t}){return e&&Array.isArray(e)&&e.length>0?e.reduce((e,a)=>{const{name:r,stylesPath:n,foreignThemes:o}=a;r&&n&&y(e,{name:t?`${r}.min.css`:`${r}.css`,path:n}),o&&Array.isArray(o)&&o.length>0&&o.forEach(t=>{const a=s.basename(t),r=t.replace(a,"").trim();y(e,{name:a,path:r})})},[]):[]}function d({provider:e,themes:s,preventMoveDTS:t=!1}){const a=s&&s.bvTools?s.reduce((e,{bvTools:s})=>{const{path:a,declarationHelp:r,cssVariables:n,cssClassNames:o,cssMediaQueries:i,cssGlobalStyles:c,availableComponents:m}=s,l=r&&!t;return n&&(y(e,{name:"cssVars.js",path:a}),l&&y(e,{name:"cssVars.d.ts",path:a})),o&&(y(e,{name:"cssClasses.js",path:a}),l&&y(e,{name:"cssClasses.d.ts",path:a})),i&&(y(e,{name:"cssMediaQueries.js",path:a}),l&&y(e,{name:"cssMediaQueries.d.ts",path:a})),c&&(y(e,{name:"cssGlobalStyles.js",path:a}),l&&y(e,{name:"cssGlobalStyles.d.ts",path:a})),m&&(y(e,{name:"cssAvailableComponents.js",path:a}),l&&y(e,{name:"cssAvailableComponents.d.js",path:a})),e},[]):[];return e&&(y(a,{name:`${e.name.toLocaleLowerCase()}.js`,path:e.path}),y(a,{name:"stats.js",path:`${e.path}/stats`}),e.declarationHelp&&!t&&(y(a,{name:`${e.name.toLocaleLowerCase()}.d.ts`,path:e.path}),y(a,{name:"stats.d.ts",path:`${e.path}/stats`}))),a}function v({cssThemes:e,cssOutPath:t}){return Object.entries(e).reduce((e,[a,{foreign:r}])=>{const{before:n,after:o}=r;n&&Array.isArray(n)&&n.length>0&&n.reduce((e,a,r)=>{const n=s.basename(a);return r>0&&(e+=", "),e+`'${t}${n}'`},""),o&&Array.isArray(o)&&o.length>0&&o.reduce((e,a,r)=>{const n=s.basename(a);return r>0&&(e+=", "),e+`'${t}${n}'`},"")},"")}function y(e,s){e.some(e=>e.name===s.name&&e.path===s.path)||e.push(s)}(async()=>{const e=process.cwd(),t=await i(s.resolve(e,"bernova.config.json")),{compilerOptions:a,provider:r,themes:n}=t;a&&r&&n||(console.error("Invalid configuration: Missing compilerOptions, themes or provider"),process.exit(1));const{baseOutDir:o,rootDir:c,minifyCss:u,minifyJS:h,preventMoveJS:v,preventMoveDTS:y,types:b,customOutDirs:D}=a,O=f({themes:n,minifyCss:u}),g=d({provider:r,themes:n,preventMoveDTS:y});if(b&&Array.isArray(b)&&b.length>0)for(const s of b){const t=p({baseOutDir:o,type:s});if(O&&O.length>0&&await l({baseOutPath:t,cssFiles:O,rootDir:c,customOutDirs:D,dir:e}),g&&g.length>0)for(const a of g)await m({baseOutPath:t,jsFile:a,rootDir:c,customOutDirs:D,dir:e,minifyJS:h,preventMoveJS:v,provider:r,type:s})}else{const s=p({baseOutDir:o});if(O&&O.length>0&&await l({baseOutPath:s,cssFiles:O,rootDir:c,customOutDirs:D,dir:e}),g&&g.length>0)for(const t of g)await m({baseOutPath:s,jsFile:t,rootDir:c,customOutDirs:D,dir:e,minifyJS:h,preventMoveJS:v,provider:r})}})();
|