@devup-ui/bun-plugin 1.0.2 → 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 +1 -1
- package/dist/index.mjs +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var{defineProperty:
|
|
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
|
|
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};
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
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.
|
|
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,7 +41,8 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@devup-ui/
|
|
44
|
+
"@devup-ui/plugin-utils": "^1.0.1",
|
|
45
|
+
"@devup-ui/wasm": "^1.0.57"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@types/bun": "latest",
|