@devup-ui/bun-plugin 1.0.3 → 1.0.4

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 CHANGED
@@ -1 +1 @@
1
- var{defineProperty:Q,getOwnPropertyNames:_,getOwnPropertyDescriptor:$}=Object,z=Object.prototype.hasOwnProperty;var X=new WeakMap,E=(q)=>{var A=X.get(q),G;if(A)return A;if(A=Q({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function")_(q).map((J)=>!z.call(A,J)&&Q(A,J,{get:()=>q[J],enumerable:!(G=$(q,J))||G.enumerable}));return X.set(q,A),A};var L=(q,A)=>{for(var G in A)Q(q,G,{get:A[G],enumerable:!0,configurable:!0,set:(J)=>A[G]=()=>J})};var C={};L(C,{plugin:()=>W.plugin});module.exports=E(C);var V=require("node:fs"),M=require("node:fs/promises"),B=require("node:path"),Y=require("@devup-ui/plugin-utils"),H=require("@devup-ui/wasm"),W=require("bun"),R="@devup-ui/react",U="devup.json",O="df",K=B.resolve(O,"devup-ui"),I=!0;async function N(){let q={};try{q=(await Y.loadDevupConfig(U)).theme??{}}catch{}if(H.registerTheme(q),await M.writeFile(B.join(O,"theme.d.ts"),H.getThemeInterface(R,"CustomColors","DevupThemeTypography","DevupTheme"),"utf-8"),!V.existsSync(K))await M.mkdir(K,{recursive:!0})}async function T(){if(!V.existsSync(O))await M.mkdir(O,{recursive:!0});await M.writeFile(B.join(O,".gitignore"),"*","utf-8"),await N()}function x(q,A){let G=B.basename(q).split("?")[0],J=A?B.resolve(B.dirname(A),q):B.resolve(q),Z=B.resolve(B.join(K,G));if(!B.relative(J,Z)||q.startsWith(K))return{path:B.join(K,G)};return}async function y(q){let A=q.endsWith(".tsx")?"tsx":q.endsWith(".ts")?"ts":q.endsWith(".jsx")?"jsx":"js",G=await Bun.file(q).text();if(H.hasDevupUI(q,G,R))return{contents:H.codeExtract(q,G,R,B.relative(B.dirname(q),K).replaceAll("\\","/"),I,!0,!1).code,loader:A};return{contents:G,loader:A}}W.plugin({name:"devup-ui",async setup(q){await T(),H.setDebug(!0),q.onResolve({filter:/devup-ui(-\d+)?\.css$/},({path:A,importer:G})=>x(A,G)),q.onLoad({filter:/.*\.(tsx|ts|jsx|mjs)/},({path:A})=>y(A))}});
1
+ var{defineProperty:V,getOwnPropertyNames:$,getOwnPropertyDescriptor:z}=Object,E=Object.prototype.hasOwnProperty;var Z=new WeakMap,L=(q)=>{var B=Z.get(q),H;if(B)return B;if(B=V({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function")$(q).map((K)=>!E.call(B,K)&&V(B,K,{get:()=>q[K],enumerable:!(H=z(q,K))||H.enumerable}));return Z.set(q,B),B};var U=(q,B)=>{for(var H in B)V(q,H,{get:B[H],enumerable:!0,configurable:!0,set:(K)=>B[H]=()=>K})};var S={};U(S,{plugin:()=>Y.plugin});module.exports=L(S);var X=require("node:fs"),O=require("node:fs/promises"),G=require("node:path"),R=require("@devup-ui/plugin-utils"),J=require("@devup-ui/wasm"),Y=require("bun"),W="@devup-ui/react",A="devup.json",Q="df",M=G.resolve(Q,"devup-ui"),N=!0,T=R.mergeImportAliases();async function x(){let q={};try{q=(await R.loadDevupConfig(A)).theme??{}}catch{}if(J.registerTheme(q),await O.writeFile(G.join(Q,"theme.d.ts"),J.getThemeInterface(W,"CustomColors","DevupThemeTypography","DevupTheme"),"utf-8"),!X.existsSync(M))await O.mkdir(M,{recursive:!0})}async function y(){if(!X.existsSync(Q))await O.mkdir(Q,{recursive:!0});await O.writeFile(G.join(Q,".gitignore"),"*","utf-8"),await x()}function C(q,B){let H=G.basename(q).split("?")[0],K=B?G.resolve(G.dirname(B),q):G.resolve(q),_=G.resolve(G.join(M,H));if(!G.relative(K,_)||q.startsWith(M))return{path:G.join(M,H)};return}async function I(q){let B=q.endsWith(".tsx")?"tsx":q.endsWith(".ts")?"ts":q.endsWith(".jsx")?"jsx":"js",H=await Bun.file(q).text();if(J.hasDevupUI(q,H,W))return{contents:J.codeExtract(q,H,W,G.relative(G.dirname(q),M).replaceAll("\\","/"),N,!0,!1,T).code,loader:B};return{contents:H,loader:B}}Y.plugin({name:"devup-ui",async setup(q){await y(),J.setDebug(!0),q.onResolve({filter:/devup-ui(-\d+)?\.css$/},({path:B,importer:H})=>C(B,H)),q.onLoad({filter:/.*\.(tsx|ts|jsx|mjs)/},({path:B})=>I(B))}});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{existsSync as Q}from"node:fs";import{mkdir as R,writeFile as V}from"node:fs/promises";import{basename as Z,dirname as W,join as K,relative as X,resolve as J}from"node:path";import{loadDevupConfig as _}from"@devup-ui/plugin-utils";import{codeExtract as $,getThemeInterface as z,hasDevupUI as E,registerTheme as L,setDebug as U}from"@devup-ui/wasm";import{plugin as I}from"bun";var M="@devup-ui/react",N="devup.json",H="df",G=J(H,"devup-ui"),T=!0;async function x(){let q={};try{q=(await _(N)).theme??{}}catch{}if(L(q),await V(K(H,"theme.d.ts"),z(M,"CustomColors","DevupThemeTypography","DevupTheme"),"utf-8"),!Q(G))await R(G,{recursive:!0})}async function y(){if(!Q(H))await R(H,{recursive:!0});await V(K(H,".gitignore"),"*","utf-8"),await x()}function C(q,A){let B=Z(q).split("?")[0],O=A?J(W(A),q):J(q),Y=J(K(G,B));if(!X(O,Y)||q.startsWith(G))return{path:K(G,B)};return}async function S(q){let A=q.endsWith(".tsx")?"tsx":q.endsWith(".ts")?"ts":q.endsWith(".jsx")?"jsx":"js",B=await Bun.file(q).text();if(E(q,B,M))return{contents:$(q,B,M,X(W(q),G).replaceAll("\\","/"),T,!0,!1).code,loader:A};return{contents:B,loader:A}}I({name:"devup-ui",async setup(q){await y(),U(!0),q.onResolve({filter:/devup-ui(-\d+)?\.css$/},({path:A,importer:B})=>C(A,B)),q.onLoad({filter:/.*\.(tsx|ts|jsx|mjs)/},({path:A})=>S(A))}});export{I as plugin};
1
+ import{existsSync as R}from"node:fs";import{mkdir as V,writeFile as W}from"node:fs/promises";import{basename as _,dirname as X,join as M,relative as Y,resolve as K}from"node:path";import{loadDevupConfig as $,mergeImportAliases as z}from"@devup-ui/plugin-utils";import{codeExtract as E,getThemeInterface as L,hasDevupUI as U,registerTheme as A,setDebug as N}from"@devup-ui/wasm";import{plugin as T}from"bun";var O="@devup-ui/react",x="devup.json",J="df",H=K(J,"devup-ui"),y=!0,C=z();async function I(){let q={};try{q=(await $(x)).theme??{}}catch{}if(A(q),await W(M(J,"theme.d.ts"),L(O,"CustomColors","DevupThemeTypography","DevupTheme"),"utf-8"),!R(H))await V(H,{recursive:!0})}async function S(){if(!R(J))await V(J,{recursive:!0});await W(M(J,".gitignore"),"*","utf-8"),await I()}function j(q,B){let G=_(q).split("?")[0],Q=B?K(X(B),q):K(q),Z=K(M(H,G));if(!Y(Q,Z)||q.startsWith(H))return{path:M(H,G)};return}async function w(q){let B=q.endsWith(".tsx")?"tsx":q.endsWith(".ts")?"ts":q.endsWith(".jsx")?"jsx":"js",G=await Bun.file(q).text();if(U(q,G,O))return{contents:E(q,G,O,Y(X(q),H).replaceAll("\\","/"),y,!0,!1,C).code,loader:B};return{contents:G,loader:B}}T({name:"devup-ui",async setup(q){await S(),N(!0),q.onResolve({filter:/devup-ui(-\d+)?\.css$/},({path:B,importer:G})=>j(B,G)),q.onLoad({filter:/.*\.(tsx|ts|jsx|mjs)/},({path:B})=>w(B))}});export{T as plugin};
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAmG5B,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAqG5B,OAAO,EAAE,MAAM,EAAE,CAAA"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "bun"
19
19
  ],
20
20
  "type": "module",
21
- "version": "1.0.3",
21
+ "version": "1.0.4",
22
22
  "scripts": {
23
23
  "lint": "eslint",
24
24
  "build": "tsc && bun build --target node src/index.ts --production --env=disable --outfile dist/index.cjs --format cjs --packages external && bun build --target node src/index.ts --production --env=disable --outfile dist/index.mjs --format esm --packages external"
@@ -41,8 +41,8 @@
41
41
  "dist"
42
42
  ],
43
43
  "dependencies": {
44
- "@devup-ui/plugin-utils": "^1.0.0",
45
- "@devup-ui/wasm": "^1.0.56"
44
+ "@devup-ui/plugin-utils": "^1.0.1",
45
+ "@devup-ui/wasm": "^1.0.57"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/bun": "latest",