@devup-ui/rsbuild-plugin 1.0.9 → 1.0.11
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 +19 -17
- package/package.json +4 -4
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 i=require("node:fs/promises"),d=require("node:path"),w=require("@devup-ui/wasm");let s="";const v=({include:u=[],package:a="@devup-ui/react",extractCss:g=!0,interfacePath:n="df",cssFile:e=d.resolve(n,"devup-ui.css")}={})=>({name:"devup-ui-rsbuild-plugin",async setup(o){g&&(await i.mkdir(n,{recursive:!0}),await i.writeFile(d.join(n,".gitignore"),"*",{encoding:"utf-8"}),await i.writeFile(e,""),o.transform({test:e},()=>s),o.transform({test:/\.(tsx|ts|js|mjs|jsx)$/},async({code:l,resourcePath:t})=>{if(u.length?new RegExp(`node_modules(?!(${u.map(m=>`.*${m}`).join("|").replaceAll("/","[\\/\\\\_]")})([\\/\\\\.]|$))`).test(t):t.includes("node_modules"))return l;const{code:p,css:r,map:c}=w.codeExtract(t,l,a,e);return r&&s.length<r.length&&(s=r,await i.writeFile(e,`/* ${t} ${Date.now()} */`,{encoding:"utf-8"})),{code:p,map:c}}))}});exports.DevupUIRsbuildPlugin=v;
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,MAAM,WAAW,2BAA2B;IAC1C,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;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAID,eAAO,MAAM,oBAAoB,GAAI,wEAMlC,OAAO,CAAC,2BAA2B,CAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,MAAM,WAAW,2BAA2B;IAC1C,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;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAID,eAAO,MAAM,oBAAoB,GAAI,wEAMlC,OAAO,CAAC,2BAA2B,CAAM,KAAG,aAqD7C,CAAA"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import { mkdir as
|
|
2
|
-
import {
|
|
1
|
+
import { mkdir as f, writeFile as r } from "node:fs/promises";
|
|
2
|
+
import { join as c, resolve as w } from "node:path";
|
|
3
3
|
import { codeExtract as v } from "@devup-ui/wasm";
|
|
4
|
-
let
|
|
5
|
-
const
|
|
6
|
-
include:
|
|
4
|
+
let i = "";
|
|
5
|
+
const b = ({
|
|
6
|
+
include: s = [],
|
|
7
7
|
package: m = "@devup-ui/react",
|
|
8
8
|
extractCss: a = !0,
|
|
9
|
-
interfacePath:
|
|
10
|
-
cssFile: t =
|
|
9
|
+
interfacePath: n = "df",
|
|
10
|
+
cssFile: t = w(n, "devup-ui.css")
|
|
11
11
|
} = {}) => ({
|
|
12
12
|
name: "devup-ui-rsbuild-plugin",
|
|
13
13
|
async setup(u) {
|
|
14
|
-
a && (await
|
|
14
|
+
a && (await f(n, { recursive: !0 }), await r(c(n, ".gitignore"), "*", {
|
|
15
|
+
encoding: "utf-8"
|
|
16
|
+
}), await r(t, ""), u.transform(
|
|
15
17
|
{
|
|
16
18
|
test: t
|
|
17
19
|
},
|
|
18
|
-
() =>
|
|
20
|
+
() => i
|
|
19
21
|
), u.transform(
|
|
20
22
|
{
|
|
21
23
|
test: /\.(tsx|ts|js|mjs|jsx)$/
|
|
22
24
|
},
|
|
23
|
-
async ({ code:
|
|
24
|
-
if (
|
|
25
|
-
`node_modules(?!(${
|
|
25
|
+
async ({ code: d, resourcePath: e }) => {
|
|
26
|
+
if (s.length ? new RegExp(
|
|
27
|
+
`node_modules(?!(${s.map((g) => `.*${g}`).join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$))`
|
|
26
28
|
).test(e) : e.includes("node_modules"))
|
|
27
|
-
return
|
|
29
|
+
return d;
|
|
28
30
|
const {
|
|
29
31
|
code: l,
|
|
30
|
-
css:
|
|
32
|
+
css: o,
|
|
31
33
|
map: p
|
|
32
|
-
} = v(e,
|
|
33
|
-
return
|
|
34
|
+
} = v(e, d, m, t);
|
|
35
|
+
return o && i.length < o.length && (i = o, await r(t, `/* ${e} ${Date.now()} */`, {
|
|
34
36
|
encoding: "utf-8"
|
|
35
37
|
})), {
|
|
36
38
|
code: l,
|
|
@@ -41,5 +43,5 @@ const j = ({
|
|
|
41
43
|
}
|
|
42
44
|
});
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
b as DevupUIRsbuildPlugin
|
|
45
47
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rsbuild"
|
|
19
19
|
],
|
|
20
20
|
"type": "module",
|
|
21
|
-
"version": "1.0.
|
|
21
|
+
"version": "1.0.11",
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@devup-ui/wasm": "1.0.
|
|
48
|
+
"@devup-ui/wasm": "1.0.15"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@devup-ui/wasm": "*",
|
|
52
52
|
"@rsbuild/core": "*"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@rsbuild/core": "^1.4.
|
|
56
|
-
"vite": "^7.0.
|
|
55
|
+
"@rsbuild/core": "^1.4.7",
|
|
56
|
+
"vite": "^7.0.5",
|
|
57
57
|
"vite-plugin-dts": "^4.5.4",
|
|
58
58
|
"vitest": "^3.2.4",
|
|
59
59
|
"typescript": "^5.8.3"
|