@devup-ui/vite-plugin 0.1.51 → 0.1.53
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/plugin.cjs +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +9 -8
- package/package.json +2 -2
package/dist/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("node:fs"),m=require("node:fs/promises"),a=require("node:path"),c=require("@devup-ui/wasm"),d=require("vite");function p(e){var t;if(s.existsSync(e.interfacePath)||s.mkdirSync(e.interfacePath),s.existsSync(e.devupPath)){c.registerTheme((t=JSON.parse(s.readFileSync(e.devupPath,"utf-8")))==null?void 0:t.theme);const u=c.getThemeInterface(e.package,"DevupThemeColors","DevupThemeTypography","DevupTheme");u&&s.writeFileSync(a.join(e.interfacePath,"theme.d.ts"),u,{encoding:"utf-8"})}s.existsSync(e.cssFile)||s.writeFileSync(e.cssFile,"",{encoding:"utf-8"})}let o="";function v({package:e="@devup-ui/react",devupPath:t="devup.json",interfacePath:u=".df",cssFile:i=a.resolve(u,"devup-ui.css"),extractCss:l=!0,debug:g=!1}={}){c.setDebug(g);try{p({package:e,cssFile:i,devupPath:t,interfacePath:u})}catch(r){console.error(r)}return{name:"devup-ui",config(){const r={server:{watch:{ignored:[`!${t}`]}}};return l&&(r.build={rollupOptions:{output:{manualChunks(n){if(n.startsWith("devup-ui.css"))return"devup-ui.css"}}}}),r},apply(){return!0},watchChange(r){if(a.resolve(r)===a.resolve(t)&&s.existsSync(t))try{p({package:e,cssFile:i,devupPath:t,interfacePath:u})}catch(n){console.error(n)}},resolveId(r){if(d.normalizePath(r)===d.normalizePath(i))return`devup-ui.css?t=${Date.now().toString()+o.length}`},load(r){if(r.split("?")[0]==="devup-ui.css")return o=c.getCss()},enforce:"pre",async transform(r,n){if(!l||n.includes("node_modules")||!/\.(tsx|ts|js|mjs|jsx)$/i.test(n))return;const{code:h,css:f}=c.codeExtract(n,r,e,i);return f&&o.length<f.length&&(o=f,await m.writeFile(i,`/* ${n} ${Date.now()} */`,{encoding:"utf-8"})),{code:h}}}}exports.DevupUI=v;
|
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":"AAWA,OAAO,EAAiB,KAAK,YAAY,EAAmB,MAAM,MAAM,CAAA;AAExE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;CACf;AA8BD,wBAAgB,OAAO,CAAC,EACtB,OAAO,EAAE,UAA8B,EACvC,SAAwB,EACxB,aAAqB,EACrB,OAAgD,EAChD,UAAiB,EACjB,KAAa,GACd,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAAG,YAAY,CAoFnD"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { existsSync as c, mkdirSync as
|
|
1
|
+
import { existsSync as c, mkdirSync as h, readFileSync as v, writeFileSync as m } from "node:fs";
|
|
2
2
|
import { writeFile as y } from "node:fs/promises";
|
|
3
3
|
import { resolve as a, join as w } from "node:path";
|
|
4
|
-
import { setDebug as D, codeExtract as S, registerTheme as T, getThemeInterface as j } from "@devup-ui/wasm";
|
|
4
|
+
import { setDebug as D, codeExtract as C, getCss as S, registerTheme as T, getThemeInterface as j } from "@devup-ui/wasm";
|
|
5
5
|
import { normalizePath as p } from "vite";
|
|
6
6
|
function d(e) {
|
|
7
7
|
var t;
|
|
8
|
-
if (c(e.interfacePath) ||
|
|
8
|
+
if (c(e.interfacePath) || h(e.interfacePath), c(e.devupPath)) {
|
|
9
9
|
T(
|
|
10
10
|
(t = JSON.parse(v(e.devupPath, "utf-8"))) == null ? void 0 : t.theme
|
|
11
11
|
);
|
|
@@ -24,7 +24,7 @@ function d(e) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
let o = "";
|
|
27
|
-
function
|
|
27
|
+
function O({
|
|
28
28
|
package: e = "@devup-ui/react",
|
|
29
29
|
devupPath: t = "devup.json",
|
|
30
30
|
interfacePath: u = ".df",
|
|
@@ -85,20 +85,21 @@ function F({
|
|
|
85
85
|
return `devup-ui.css?t=${Date.now().toString() + o.length}`;
|
|
86
86
|
},
|
|
87
87
|
load(r) {
|
|
88
|
-
if (r.split("?")[0] === "devup-ui.css")
|
|
88
|
+
if (r.split("?")[0] === "devup-ui.css")
|
|
89
|
+
return o = S();
|
|
89
90
|
},
|
|
90
91
|
enforce: "pre",
|
|
91
92
|
async transform(r, n) {
|
|
92
93
|
if (!f || n.includes("node_modules") || !/\.(tsx|ts|js|mjs|jsx)$/i.test(n)) return;
|
|
93
|
-
const { code:
|
|
94
|
+
const { code: g, css: s } = C(n, r, e, i);
|
|
94
95
|
return s && o.length < s.length && (o = s, await y(i, `/* ${n} ${Date.now()} */`, {
|
|
95
96
|
encoding: "utf-8"
|
|
96
97
|
})), {
|
|
97
|
-
code:
|
|
98
|
+
code: g
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
103
|
export {
|
|
103
|
-
|
|
104
|
+
O as DevupUI
|
|
104
105
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devup-ui/vite-plugin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.53",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@devup-ui/wasm": "0.1.
|
|
22
|
+
"@devup-ui/wasm": "0.1.49"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"vite-plugin-dts": "^4.5.0",
|