@devup-ui/rsbuild-plugin 1.0.8 → 1.0.10

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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("node:fs/promises"),m=require("node:path"),v=require("@devup-ui/wasm");let r="";const w=({include:u=[],package:d="@devup-ui/react",extractCss:a=!0,interfacePath:i=".df",cssFile:e=m.resolve(i,"devup-ui.css")}={})=>({name:"devup-ui-rsbuild-plugin",async setup(o){a&&(await s.mkdir(i,{recursive:!0}),await s.writeFile(e,""),o.transform({test:e},()=>r),o.transform({test:/\.(tsx|ts|js|mjs|jsx)$/},async({code:l,resourcePath:t})=>{if(u.length?new RegExp(`node_modules(?!(${u.map(g=>`.*${g}`).join("|").replaceAll("/","[\\/\\\\_]")})([\\/\\\\.]|$))`).test(t):t.includes("node_modules"))return l;const{code:p,css:n,map:c}=v.codeExtract(t,l,d,e);return n&&r.length<n.length&&(r=n,await s.writeFile(e,`/* ${t} ${Date.now()} */`,{encoding:"utf-8"})),{code:p,map:c}}))}});exports.DevupUIRsbuildPlugin=w;
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;
@@ -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,aAkD7C,CAAA"}
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 g, writeFile as d } from "node:fs/promises";
2
- import { resolve as c } from "node:path";
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 n = "";
5
- const j = ({
6
- include: o = [],
4
+ let i = "";
5
+ const b = ({
6
+ include: s = [],
7
7
  package: m = "@devup-ui/react",
8
8
  extractCss: a = !0,
9
- interfacePath: s = ".df",
10
- cssFile: t = c(s, "devup-ui.css")
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 g(s, { recursive: !0 }), await d(t, ""), u.transform(
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
- () => n
20
+ () => i
19
21
  ), u.transform(
20
22
  {
21
23
  test: /\.(tsx|ts|js|mjs|jsx)$/
22
24
  },
23
- async ({ code: i, resourcePath: e }) => {
24
- if (o.length ? new RegExp(
25
- `node_modules(?!(${o.map((f) => `.*${f}`).join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$))`
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 i;
29
+ return d;
28
30
  const {
29
31
  code: l,
30
- css: r,
32
+ css: o,
31
33
  map: p
32
- } = v(e, i, m, t);
33
- return r && n.length < r.length && (n = r, await d(t, `/* ${e} ${Date.now()} */`, {
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
- j as DevupUIRsbuildPlugin
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.8",
21
+ "version": "1.0.10",
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.12"
48
+ "@devup-ui/wasm": "1.0.14"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@devup-ui/wasm": "*",
52
52
  "@rsbuild/core": "*"
53
53
  },
54
54
  "devDependencies": {
55
- "@rsbuild/core": "^1.4.2",
56
- "vite": "^7.0.0",
55
+ "@rsbuild/core": "^1.4.5",
56
+ "vite": "^7.0.3",
57
57
  "vite-plugin-dts": "^4.5.4",
58
58
  "vitest": "^3.2.4",
59
59
  "typescript": "^5.8.3"