@lntvow/vite-plugin 1.3.0 → 1.3.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/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var j=Object.create;var h=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var P=(o,e)=>{for(var r in e)h(o,r,{get:e[r],enumerable:!0})},$=(o,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of k(e))!L.call(o,t)&&t!==r&&h(o,t,{get:()=>e[t],enumerable:!(n=M(e,t))||n.enumerable});return o};var z=(o,e,r)=>(r=o!=null?j(E(o)):{},$(e||!o||!o.__esModule?h(r,"default",{value:o,enumerable:!0}):r,o)),D=o=>$(h({},"__esModule",{value:!0}),o);var F={};P(F,{vitePluginEnvRibbon:()=>T,vitePluginVersionLog:()=>q});module.exports=D(F);function T(o={}){let e="vite-plugin-env-ribbon",{width:r=150,height:n=20,fontSize:t=12,backgroundColor:l="hsla(0, 100%, 33%, 0.733)",color:s="#fff",position:d="top-right",envMap:g={}}=o,c;return{name:e,transformIndexHtml(i){if(c==="production")return i;let u=g[c]||c;if(!u)return i;let p=d==="top-left",w=p?`translate(-${n/Math.sqrt(2)}px, -${n/Math.sqrt(2)}px) translate(0, ${r/Math.sqrt(2)}px) rotate(-45deg)`:`translate(${n/Math.sqrt(2)}px, -${n/Math.sqrt(2)}px) translate(0, ${r/Math.sqrt(2)}px) rotate(45deg)`,b=p?"left top":"right top",y=p?"auto":"0",O=p?"0":"auto",S=["position: fixed",`width: ${r}px`,`height: ${n}px`,`background: ${l}`,`color: ${s}`,`font-size: ${t}px`,`line-height: ${n}px`,`transform: ${w}`,`transform-origin: ${b}`,"top: 0",`right: ${y}`,`left: ${O}`,"z-index: 9999","text-align: center","pointer-events: none","user-select: none","overflow: hidden"].join(";");return{html:i,tags:[{tag:"div",attrs:{style:S,id:e},children:u,injectTo:"body"}]}},configResolved(i){c=i.mode}}}var m=require("fs"),a=require("path");var f=z(require("picocolors"),1);function x(o){let e=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}),r=t=>e.format(t);return{info:t=>console.log(n("info",t)),warn:t=>console.log(n("warn",t)),error:t=>console.log(n("error",t))};function n(t,l){let s={info:f.default.cyan,warn:f.default.yellow,error:f.default.red};return`${f.default.dim(r(new Date))} ${s[t](f.default.bold(`[${o}]`))} ${s[t](l)}`}}function q(o={}){let{name:e="LNTVOW_VERSION",timezone:r=Intl.DateTimeFormat().resolvedOptions().timeZone,entry:n}=o,{version:t}=o,l="vite-plugin-version-log",s=x(l),d=["src/main.ts","src/main.js"].map(i=>(0,a.resolve)(process.cwd(),i)),g;if(n){if(g=(0,a.isAbsolute)(n)?n:(0,a.resolve)(process.cwd(),n),!(0,m.existsSync)(g)){s.error(`Entry file not found: ${g}`);return}}else if(g=d.find(i=>(0,m.existsSync)(i)),!g){s.error(`Default entry files (${d.join(", ")}) were not found.`),s.error('Specify a custom path via the "entry" option to use a different file.');return}let c=new Intl.DateTimeFormat("sv-SE",{timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date);if(!t)try{let i=(0,m.readFileSync)((0,a.resolve)(process.cwd(),"package.json"),"utf8");t=JSON.parse(i).version}catch(i){t="unknown",console.log("error: ",i),s.warn("Failed to read version from package.json. Using 'unknown' as version.")}return{name:l,transform(i,u){if((0,a.normalize)(u)===(0,a.normalize)(g))return{code:[i,`localStorage.setItem('${e}', JSON.stringify(['${c}', '${t}']))`,`console.log('[Log] version:', ['${c}', '${t}']);`].join(";")}}}}0&&(module.exports={vitePluginEnvRibbon,vitePluginVersionLog});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/vite-plugin",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "description": "Collection of custom vite plugins",
6
6
  "keywords": [
@@ -15,11 +15,13 @@
15
15
  "dist"
16
16
  ],
17
17
  "types": "dist/index.d.ts",
18
- "main": "dist/index.js",
18
+ "main": "dist/index.cjs",
19
+ "module": "dist/index.mjs",
19
20
  "exports": {
20
21
  "types": "./dist/index.d.ts",
21
- "import": "./dist/index.js",
22
- "default": "./dist/index.js"
22
+ "require": "./dist/index.cjs",
23
+ "import": "./dist/index.mjs",
24
+ "default": "./dist/index.cjs"
23
25
  },
24
26
  "dependencies": {
25
27
  "picocolors": "^1.1.1"
File without changes