bernova 1.7.7 → 1.7.9

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Merge pull request #38 from kubit-ui/fix/prevent-process-js-logic-fixed
8
+
9
+ ## 1.7.8
10
+
11
+ ### Patch Changes
12
+
13
+ - Merge pull request #37 from kubit-ui/fix/css-path-in-window-os
14
+
3
15
  ## 1.7.7
4
16
 
5
17
  ### Patch Changes
@@ -1 +1 @@
1
- const o=require("path"),{getBernovaBuildArgs:e,getBaseOutDir:t}=require("./getFx"),{readConfigData:s}=require("../../src/lib"),{copyCssFiles:i,embedCssForProvider:r,rewriteCssPathInStats:n,writeStatsinBuild:a,writeToolsInBuild:c,rewriteProviderTemplate:l}=require("./writeFx"),{isIterableArray:p,buildCustomOutDirs:u}=require("./utils");async function d(){console.log("Reading configuration...");const d=process.cwd(),{themes:f,provider:v,compilerOptions:y}=await s(o.resolve(d,"bernova.config.json")),{minifyCss:g,minifyJS:m,...h}=y,{css:w,tools:S,provider:C,...b}=e(["--base-out-dir","--root-dir","--prevent-process-js","--prevent-move-js","--prevent-move-dts","--types","--css","--tools","--provider","--embed-css"]),D=(()=>{const o={};return w&&(o.css=w),S&&(o.tools=S),C&&(o.provider=C),Object.keys(o).length>0?o:void 0})(),{baseOutDir:P="",rootDir:O,preventMoveJS:j,preventMoveDTS:B,preventProcessJs:T,types:J,embedCss:q,customOutDirs:M}=u({jsonConfig:h,cliConfig:{...b,customOutDirs:D}}),F=p(J)?J:[""];async function x(){const o=M?.css;if(p(f)){for(const e of f)q?await r({dir:d,theme:e,provider:v}):o&&await n({dir:d,theme:e,css:o,provider:v});await l({dir:d,embedCss:q,provider:v})}}async function I(){const e=M?.css;if(p(f))for(const t of f){const s=e??t.stylesPath??"",r=o.join(P,s);await i({dir:d,cssPath:r,theme:t})}}async function A(){let e=M?.provider??v.path??"";O&&(e=o.relative(O,e));for(const s of F){const i=t({baseOutDir:P,type:s}),r=o.join(i,e,"stats");await a({dir:d,providerPath:v.path,outPath:r,type:s,preventMoveDTS:B,minifyJS:m})}}async function k(){let e=M?.provider??v.path??"";O&&(e=o.relative(O,e));for(const s of F){const i=t({baseOutDir:P,type:s}),r=o.join(i,e);T&&await x(),await c({dir:d,toolsPath:v.path,outPath:r,preventMoveDTS:B,type:s,minifyJS:m})}}return console.log("Configuration read successfully"),{preBuildStyles:x,copyCss:I,copyStats:A,copyProvider:k,fullBuild:async function(){console.log("Copying CSS files..."),await I(),console.log("CSS files copied successfully"),j||(console.log("Copying tools files..."),await async function(){if(p(f))for(const e of f){const{bvTools:s}=e,i=s?.path;if(i){let e=M?.tools??i??"";O&&(e=o.relative(O,e));for(const s of F){const r=t({baseOutDir:P,type:s}),n=o.join(r,e);await c({dir:d,toolsPath:i,outPath:n,preventMoveDTS:B,type:s,minifyJS:m})}}}}(),console.log("Tools files copied successfully"),console.log("Copying provider and stats files..."),await k(),await A(),console.log("Provider and stats files copied successfully"))}}}module.exports={bvBuildScript:d};
1
+ const o=require("path"),{getBernovaBuildArgs:e,getBaseOutDir:t}=require("./getFx"),{readConfigData:s}=require("../../src/lib"),{copyCssFiles:i,embedCssForProvider:r,rewriteCssPathInStats:n,writeStatsinBuild:a,writeToolsInBuild:c,rewriteProviderTemplate:l}=require("./writeFx"),{isIterableArray:p,buildCustomOutDirs:u}=require("./utils");async function d(){console.log("Reading configuration...");const d=process.cwd(),{themes:f,provider:v,compilerOptions:y}=await s(o.resolve(d,"bernova.config.json")),{minifyCss:g,minifyJS:m,...h}=y,{css:w,tools:S,provider:C,...b}=e(["--base-out-dir","--root-dir","--prevent-process-js","--prevent-move-js","--prevent-move-dts","--types","--css","--tools","--provider","--embed-css"]),D=(()=>{const o={};return w&&(o.css=w),S&&(o.tools=S),C&&(o.provider=C),Object.keys(o).length>0?o:void 0})(),{baseOutDir:P="",rootDir:O,preventMoveJS:j,preventMoveDTS:B,preventProcessJs:T,types:J,embedCss:q,customOutDirs:M}=u({jsonConfig:h,cliConfig:{...b,customOutDirs:D}}),F=p(J)?J:[""];async function x(){const o=M?.css;if(p(f)){for(const e of f)q?await r({dir:d,theme:e,provider:v}):o&&await n({dir:d,theme:e,css:o,provider:v});await l({dir:d,embedCss:q,provider:v})}}async function I(){const e=M?.css;if(p(f))for(const t of f){const s=e??t.stylesPath??"",r=o.join(P,s);await i({dir:d,cssPath:r,theme:t})}}async function A(){let e=M?.provider??v.path??"";O&&(e=o.relative(O,e));for(const s of F){const i=t({baseOutDir:P,type:s}),r=o.join(i,e,"stats");await a({dir:d,providerPath:v.path,outPath:r,type:s,preventMoveDTS:B,minifyJS:m})}}async function k(){let e=M?.provider??v.path??"";O&&(e=o.relative(O,e));for(const s of F){const i=t({baseOutDir:P,type:s}),r=o.join(i,e);T||await x(),await c({dir:d,toolsPath:v.path,outPath:r,preventMoveDTS:B,type:s,minifyJS:m})}}return console.log("Configuration read successfully"),{preBuildStyles:x,copyCss:I,copyStats:A,copyProvider:k,fullBuild:async function(){console.log("Copying CSS files..."),await I(),console.log("CSS files copied successfully"),j||(console.log("Copying tools files..."),await async function(){if(p(f))for(const e of f){const{bvTools:s}=e,i=s?.path;if(i){let e=M?.tools??i??"";O&&(e=o.relative(O,e));for(const s of F){const r=t({baseOutDir:P,type:s}),n=o.join(r,e);await c({dir:d,toolsPath:i,outPath:n,preventMoveDTS:B,type:s,minifyJS:m})}}}}(),console.log("Tools files copied successfully"),console.log("Copying provider and stats files..."),await k(),await A(),console.log("Provider and stats files copied successfully"))}}}module.exports={bvBuildScript:d};
package/dist/src/app.js CHANGED
@@ -1 +1 @@
1
- const e=require("path"),{generateBaseCss:s,compileThemes:o,generateCSS:t,compileConfig:r,writeDoc:i,generateProvider:a,processMediaConfig:l,generateThemeRegister:n,generateCssDoc:c,handlerForeignThemes:d}=require("./lib"),{validatePreviouslyExists:f,processCssWithPostcss:m}=require("./lib/generateCss/helpers"),{compilerTypeValid:g}=require("./constants"),{generateTypesTools:p}=require("./lib/generateTypesTools/generateTypesTools.utils"),{generateTools:u}=require("./lib/generateTools/generateTools.utils");async function y(y){const h=process.cwd(),T={},{default:v}=await import("ora"),C=v("Starting BernovaStyled process...").start(),{themes:D,provider:w}=await r({dir:h});for(const r of D){const{themeCss:a,fonts:v,resetCss:D,bvTools:b,name:$,stylesPath:P,typesTools:S,foreignThemes:q,prefix:x}=o({themeConfig:r,dir:h}),B=await s({fonts:v,resetCss:D,stylesPath:P}),{theme:E,media:F=[],...N}=a,V=(()=>{switch(y){case g.foundationOnly:return N;case g.componentOnly:return{theme:E,media:F};default:return a}})(),{stylesCss:j,foundationsCss:H,stylesDocs:M,rootDocs:O,globalDocs:R}=await t({source:V,baseCss:B,compilerType:y,prefix:x}),W=P?e.resolve(h,P):e.resolve(h,"styles"),{cssDir:A,cssMinifiedDir:G,oldData:k}=await f({stylesDir:W,compilerType:y,name:$}),z=c({compilerType:y,stylesCss:j,foundationsCss:H,oldData:k}),I=await m(z,!1,null),J=await m(z,!0,null);C.start(`Writing CSS to file for theme: ${$}...`),await i(A,I,"css"),await i(G,J,"css minified"),C.succeed(`CSS written to file for theme: ${$}.`),C.start(`Compiling register for theme: ${$}...`),C.succeed(`Register compiled for theme: ${$}.`),C.start("Verifying types tools..."),S?(C.succeed(`Types tools verified for theme: ${$}.`),await p({dir:h,typesTools:S,mediaConfig:F,stylesDocs:M})):C.succeed(`No types tools found for theme: ${$}.`);const K=F?l({mediaConfig:F}):null;if(C.start(`Processing bvTools for theme: ${$}...`),b?(C.succeed(`bvTools found for theme: ${$}.`),await u({bvTools:b,compilerType:y,name:$,dir:h,stylesDir:W,stylesDocs:M,rootDocs:O,globalDocs:R,mediaDocs:K})):C.succeed(`No bvTools found for theme: ${$}.`),w){C.start(`Generating theme register for theme: ${$}...`);const s=P?e.join(P,`${$}.css`):e.join("./styles",`${$}.css`),{themeByPosition:o,variablesExtracted:t,classesExtracted:r}=await d({dir:h,foreignThemes:q});T[$]=n({cssPath:s,rootDocs:O,stylesDocs:M,globalDocs:R,mediaDocs:K,foreignStyles:r,foreignVars:t,foreignBeforeFiles:o.before,foreignAfterFiles:o.after}),C.succeed(`Theme register generated for provider for theme: ${$}`)}}w&&(C.start("Provider configuration found, generating tools..."),await a({dir:e.resolve(h,w.path),providerDocs:T,declarationHelp:w.declarationHelp,providerName:w.name,compilerType:y}),C.succeed("Provider tools generated successfully."))}module.exports={bernovaStyles:y};
1
+ const e=require("path"),{generateBaseCss:s,compileThemes:o,generateCSS:t,compileConfig:r,writeDoc:i,generateProvider:a,processMediaConfig:l,generateThemeRegister:n,generateCssDoc:c,handlerForeignThemes:d}=require("./lib"),{validatePreviouslyExists:f,processCssWithPostcss:m}=require("./lib/generateCss/helpers"),{compilerTypeValid:p}=require("./constants"),{generateTypesTools:g}=require("./lib/generateTypesTools/generateTypesTools.utils"),{generateTools:u}=require("./lib/generateTools/generateTools.utils");async function y(y){const h=process.cwd(),T={},{default:v}=await import("ora"),C=v("Starting BernovaStyled process...").start(),{themes:D,provider:w}=await r({dir:h});for(const r of D){const{themeCss:a,fonts:v,resetCss:D,bvTools:b,name:$,stylesPath:P,typesTools:S,foreignThemes:x,prefix:q}=o({themeConfig:r,dir:h}),B=await s({fonts:v,resetCss:D,stylesPath:P}),{theme:E,media:F=[],...N}=a,V=(()=>{switch(y){case p.foundationOnly:return N;case p.componentOnly:return{theme:E,media:F};default:return a}})(),{stylesCss:j,foundationsCss:H,stylesDocs:M,rootDocs:O,globalDocs:R}=await t({source:V,baseCss:B,compilerType:y,prefix:q}),W=P?e.resolve(h,P):e.resolve(h,"styles"),{cssDir:A,cssMinifiedDir:G,oldData:k}=await f({stylesDir:W,compilerType:y,name:$}),z=c({compilerType:y,stylesCss:j,foundationsCss:H,oldData:k}),I=await m(z,!1,null),J=await m(z,!0,null);C.start(`Writing CSS to file for theme: ${$}...`),await i(A,I,"css"),await i(G,J,"css minified"),C.succeed(`CSS written to file for theme: ${$}.`),C.start(`Compiling register for theme: ${$}...`),C.succeed(`Register compiled for theme: ${$}.`),C.start("Verifying types tools..."),S?(C.succeed(`Types tools verified for theme: ${$}.`),await g({dir:h,typesTools:S,mediaConfig:F,stylesDocs:M})):C.succeed(`No types tools found for theme: ${$}.`);const K=F?l({mediaConfig:F}):null;if(C.start(`Processing bvTools for theme: ${$}...`),b?(C.succeed(`bvTools found for theme: ${$}.`),await u({bvTools:b,compilerType:y,name:$,dir:h,stylesDir:W,stylesDocs:M,rootDocs:O,globalDocs:R,mediaDocs:K})):C.succeed(`No bvTools found for theme: ${$}.`),w){C.start(`Generating theme register for theme: ${$}...`);const s=P?e.posix.join(P,`${$}.css`):e.posix.join("./styles",`${$}.css`),{themeByPosition:o,variablesExtracted:t,classesExtracted:r}=await d({dir:h,foreignThemes:x});T[$]=n({cssPath:s,rootDocs:O,stylesDocs:M,globalDocs:R,mediaDocs:K,foreignStyles:r,foreignVars:t,foreignBeforeFiles:o.before,foreignAfterFiles:o.after}),C.succeed(`Theme register generated for provider for theme: ${$}`)}}w&&(C.start("Provider configuration found, generating tools..."),await a({dir:e.resolve(h,w.path),providerDocs:T,declarationHelp:w.declarationHelp,providerName:w.name,compilerType:y}),C.succeed("Provider tools generated successfully."))}module.exports={bernovaStyles:y};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bernova",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
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",
package/src/app.js CHANGED
@@ -146,8 +146,8 @@ async function bernovaStyles(compilerType) {
146
146
  if (provider) {
147
147
  spinner.start(`Generating theme register for theme: ${name}...`);
148
148
  const cssPath = stylesPath
149
- ? path.join(stylesPath, `${name}.css`)
150
- : path.join('./styles', `${name}.css`);
149
+ ? path.posix.join(stylesPath, `${name}.css`)
150
+ : path.posix.join('./styles', `${name}.css`);
151
151
  const { themeByPosition, variablesExtracted, classesExtracted } =
152
152
  await handlerForeignThemes({ dir, foreignThemes });
153
153