@devup-ui/rsbuild-plugin 1.0.6 → 1.0.7

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"),c=require("node:path"),m=require("@devup-ui/wasm");let r="";const v=({include:u=[],package:d="@devup-ui/react",extractCss:a=!0,interfacePath:i=".df",cssFile:e=c.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}=m.codeExtract(t,l,d,e);return n&&r.length<n.length&&(r=n,await s.writeFile(e,`/* ${t} ${Date.now()} */`,{encoding:"utf-8"})),p}))}});exports.DevupUIRsbuildPlugin=v;
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 +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,aAgD7C,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,aAkD7C,CAAA"}
package/dist/plugin.js CHANGED
@@ -1,17 +1,17 @@
1
- import { mkdir as f, writeFile as d } from "node:fs/promises";
2
- import { resolve as g } from "node:path";
3
- import { codeExtract as c } from "@devup-ui/wasm";
1
+ import { mkdir as g, writeFile as d } from "node:fs/promises";
2
+ import { resolve as c } from "node:path";
3
+ import { codeExtract as v } from "@devup-ui/wasm";
4
4
  let n = "";
5
- const x = ({
5
+ const j = ({
6
6
  include: o = [],
7
- package: l = "@devup-ui/react",
8
- extractCss: m = !0,
7
+ package: m = "@devup-ui/react",
8
+ extractCss: a = !0,
9
9
  interfacePath: s = ".df",
10
- cssFile: t = g(s, "devup-ui.css")
10
+ cssFile: t = c(s, "devup-ui.css")
11
11
  } = {}) => ({
12
12
  name: "devup-ui-rsbuild-plugin",
13
13
  async setup(u) {
14
- m && (await f(s, { recursive: !0 }), await d(t, ""), u.transform(
14
+ a && (await g(s, { recursive: !0 }), await d(t, ""), u.transform(
15
15
  {
16
16
  test: t
17
17
  },
@@ -22,22 +22,24 @@ const x = ({
22
22
  },
23
23
  async ({ code: i, resourcePath: e }) => {
24
24
  if (o.length ? new RegExp(
25
- `node_modules(?!(${o.map((p) => `.*${p}`).join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$))`
25
+ `node_modules(?!(${o.map((f) => `.*${f}`).join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$))`
26
26
  ).test(e) : e.includes("node_modules"))
27
27
  return i;
28
- const { code: a, css: r } = c(
29
- e,
30
- i,
31
- l,
32
- t
33
- );
28
+ const {
29
+ code: l,
30
+ css: r,
31
+ map: p
32
+ } = v(e, i, m, t);
34
33
  return r && n.length < r.length && (n = r, await d(t, `/* ${e} ${Date.now()} */`, {
35
34
  encoding: "utf-8"
36
- })), a;
35
+ })), {
36
+ code: l,
37
+ map: p
38
+ };
37
39
  }
38
40
  ));
39
41
  }
40
42
  });
41
43
  export {
42
- x as DevupUIRsbuildPlugin
44
+ j as DevupUIRsbuildPlugin
43
45
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rsbuild"
19
19
  ],
20
20
  "type": "module",
21
- "version": "1.0.6",
21
+ "version": "1.0.7",
22
22
  "publishConfig": {
23
23
  "access": "public"
24
24
  },
@@ -45,7 +45,7 @@
45
45
  "dist"
46
46
  ],
47
47
  "dependencies": {
48
- "@devup-ui/wasm": "1.0.10"
48
+ "@devup-ui/wasm": "1.0.11"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@devup-ui/wasm": "*",