@devup-ui/webpack-plugin 1.0.43 → 1.0.44

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@devup-ui/wasm");function n(e){return e.endsWith("devup-ui.css")?null:parseInt(e.split("devup-ui-")[1].split(".")[0])}const r=function(e,u,i){const{watch:l}=this.getOptions(),t=n(this.resourcePath);if(!l)return this.callback(null,s.getCss(t,!0));this.callback(null,s.getCss(t,!0),u,i)};exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("@devup-ui/wasm");function l(e){return e.endsWith("devup-ui.css")?null:parseInt(e.split("devup-ui-")[1].split(".")[0])}const r=function(e,t,u){const s=l(this.resourcePath);this.callback(null,i.getCss(s,!0),t,u)};exports.default=r;
@@ -1,6 +1,4 @@
1
1
  import { RawLoaderDefinitionFunction } from 'webpack';
2
- declare const devupUICssLoader: RawLoaderDefinitionFunction<{
3
- watch: boolean;
4
- }>;
2
+ declare const devupUICssLoader: RawLoaderDefinitionFunction;
5
3
  export default devupUICssLoader;
6
4
  //# sourceMappingURL=css-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"css-loader.d.ts","sourceRoot":"","sources":["../src/css-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAO1D,QAAA,MAAM,gBAAgB,EAAE,2BAA2B,CAAC;IAClD,KAAK,EAAE,OAAO,CAAA;CACf,CAKA,CAAA;AACD,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"css-loader.d.ts","sourceRoot":"","sources":["../src/css-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAO1D,QAAA,MAAM,gBAAgB,EAAE,2BAGvB,CAAA;AACD,eAAe,gBAAgB,CAAA"}
@@ -1,12 +1,11 @@
1
- import { getCss as s } from "@devup-ui/wasm";
2
- function l(t) {
1
+ import { getCss as i } from "@devup-ui/wasm";
2
+ function n(t) {
3
3
  return t.endsWith("devup-ui.css") ? null : parseInt(t.split("devup-ui-")[1].split(".")[0]);
4
4
  }
5
- const c = function(t, u, i) {
6
- const { watch: n } = this.getOptions(), e = l(this.resourcePath);
7
- if (!n) return this.callback(null, s(e, !0));
8
- this.callback(null, s(e, !0), u, i);
5
+ const l = function(t, e, s) {
6
+ const u = n(this.resourcePath);
7
+ this.callback(null, i(u, !0), e, s);
9
8
  };
10
9
  export {
11
- c as default
10
+ l as default
12
11
  };
package/dist/loader.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("node:fs/promises"),s=require("node:path"),i=require("@devup-ui/wasm"),S=function(d){const{watch:l,package:f,cssDir:a,sheetFile:m,classMapFile:F,fileMapFile:g,singleCss:w}=this.getOptions(),o=this.async(),_=this.resourcePath;try{let e=s.relative(s.dirname(this.resourcePath),a).replaceAll("\\","/");e.startsWith("./")||(e=`./${e}`);const{code:c,css:M="",map:n,cssFile:u,updatedBaseStyle:P}=i.codeExtract(_,d.toString(),f,e,w,!1,!0),p=n?JSON.parse(n):null,r=[];if(P&&r.push(t.writeFile(s.join(a,"devup-ui.css"),i.getCss(null,!1),"utf-8")),u){const h=`${this.resourcePath} ${Date.now()}`;l&&this._compiler&&(this._compiler.__DEVUP_CACHE=h),r.push(t.writeFile(s.join(a,s.basename(u)),l?`/* ${h} */`:M)),l&&r.push(t.writeFile(m,i.exportSheet()),t.writeFile(F,i.exportClassMap()),t.writeFile(g,i.exportFileMap())),Promise.all(r).catch(console.error).finally(()=>o(null,c,p));return}o(null,c,p)}catch(e){o(e)}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("node:fs/promises"),r=require("node:path"),t=require("@devup-ui/wasm");let d=!1;const y=function(f){const{watch:o,package:m,cssDir:l,sheetFile:F,classMapFile:g,fileMapFile:w,singleCss:M,theme:c}=this.getOptions(),a=this.async(),P=this.resourcePath;c&&!d&&(d=!0,t.registerTheme(c));try{let e=r.relative(r.dirname(this.resourcePath),l).replaceAll("\\","/");e.startsWith("./")||(e=`./${e}`);const{code:n,css:S="",map:u,cssFile:p,updatedBaseStyle:b}=t.codeExtract(P,f.toString(),m,e,M,!1,!0),h=u?JSON.parse(u):null,i=[];if(b&&i.push(s.writeFile(r.join(l,"devup-ui.css"),t.getCss(null,!1),"utf-8")),p){const v=`${this.resourcePath} ${Date.now()}`;i.push(s.writeFile(r.join(l,r.basename(p)),o?`/* ${v} */`:S)),o&&i.push(s.writeFile(F,t.exportSheet()),s.writeFile(g,t.exportClassMap()),s.writeFile(w,t.exportFileMap())),Promise.all(i).catch(console.error).finally(()=>a(null,n,h));return}a(null,n,h)}catch(e){a(e)}};exports.default=y;
package/dist/loader.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface DevupUILoaderOptions {
7
7
  fileMapFile: string;
8
8
  watch: boolean;
9
9
  singleCss: boolean;
10
+ theme?: object;
10
11
  }
11
12
  declare const devupUILoader: RawLoaderDefinitionFunction<DevupUILoaderOptions>;
12
13
  export default devupUILoader;
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,QAAA,MAAM,aAAa,EAAE,2BAA2B,CAAC,oBAAoB,CAwElE,CAAA;AACH,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAGD,QAAA,MAAM,aAAa,EAAE,2BAA2B,CAAC,oBAAoB,CA2ElE,CAAA;AACH,eAAe,aAAa,CAAA"}
package/dist/loader.js CHANGED
@@ -1,58 +1,61 @@
1
1
  import { writeFile as t } from "node:fs/promises";
2
- import { relative as M, dirname as _, join as u, basename as y } from "node:path";
3
- import { codeExtract as S, getCss as $, exportSheet as b, exportClassMap as k, exportFileMap as v } from "@devup-ui/wasm";
4
- const A = function(h) {
2
+ import { relative as $, dirname as b, join as u, basename as k } from "node:path";
3
+ import { registerTheme as v, codeExtract as w, getCss as C, exportSheet as D, exportClassMap as O, exportFileMap as j } from "@devup-ui/wasm";
4
+ let h = !1;
5
+ const I = function(f) {
5
6
  const {
6
- watch: r,
7
- package: f,
8
- cssDir: i,
9
- sheetFile: m,
10
- classMapFile: d,
11
- fileMapFile: g,
12
- singleCss: F
13
- } = this.getOptions(), a = this.async(), P = this.resourcePath;
7
+ watch: i,
8
+ package: m,
9
+ cssDir: r,
10
+ sheetFile: d,
11
+ classMapFile: g,
12
+ fileMapFile: F,
13
+ singleCss: x,
14
+ theme: l
15
+ } = this.getOptions(), a = this.async(), M = this.resourcePath;
16
+ l && !h && (h = !0, v(l));
14
17
  try {
15
- let e = M(_(this.resourcePath), i).replaceAll(
18
+ let e = $(b(this.resourcePath), r).replaceAll(
16
19
  "\\",
17
20
  "/"
18
21
  );
19
22
  e.startsWith("./") || (e = `./${e}`);
20
23
  const {
21
24
  code: o,
22
- css: x = "",
23
- map: l,
24
- cssFile: c,
25
- updatedBaseStyle: C
26
- } = S(
27
- P,
28
- h.toString(),
29
- f,
25
+ css: P = "",
26
+ map: c,
27
+ cssFile: n,
28
+ updatedBaseStyle: y
29
+ } = w(
30
+ M,
31
+ f.toString(),
32
+ m,
30
33
  e,
31
- F,
34
+ x,
32
35
  !1,
33
36
  !0
34
- ), n = l ? JSON.parse(l) : null, s = [];
35
- if (C && s.push(
36
- t(u(i, "devup-ui.css"), $(null, !1), "utf-8")
37
- ), c) {
38
- const p = `${this.resourcePath} ${Date.now()}`;
39
- r && this._compiler && (this._compiler.__DEVUP_CACHE = p), s.push(
37
+ ), p = c ? JSON.parse(c) : null, s = [];
38
+ if (y && s.push(
39
+ t(u(r, "devup-ui.css"), C(null, !1), "utf-8")
40
+ ), n) {
41
+ const S = `${this.resourcePath} ${Date.now()}`;
42
+ s.push(
40
43
  t(
41
- u(i, y(c)),
42
- r ? `/* ${p} */` : x
44
+ u(r, k(n)),
45
+ i ? `/* ${S} */` : P
43
46
  )
44
- ), r && s.push(
45
- t(m, b()),
46
- t(d, k()),
47
- t(g, v())
48
- ), Promise.all(s).catch(console.error).finally(() => a(null, o, n));
47
+ ), i && s.push(
48
+ t(d, D()),
49
+ t(g, O()),
50
+ t(F, j())
51
+ ), Promise.all(s).catch(console.error).finally(() => a(null, o, p));
49
52
  return;
50
53
  }
51
- a(null, o, n);
54
+ a(null, o, p);
52
55
  } catch (e) {
53
56
  a(e);
54
57
  }
55
58
  };
56
59
  export {
57
- A as default
60
+ I as default
58
61
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "webpack"
19
19
  ],
20
20
  "type": "module",
21
- "version": "1.0.43",
21
+ "version": "1.0.44",
22
22
  "publishConfig": {
23
23
  "access": "public"
24
24
  },
@@ -45,17 +45,17 @@
45
45
  "dist"
46
46
  ],
47
47
  "dependencies": {
48
- "@devup-ui/wasm": "1.0.42"
48
+ "@devup-ui/wasm": "1.0.43"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@devup-ui/wasm": "*"
52
52
  },
53
53
  "devDependencies": {
54
- "vite": "^7.1.7",
55
- "@types/webpack": "^5.28.5",
56
- "vite-plugin-dts": "^4.5.4",
57
- "vitest": "^3.2.4",
58
- "typescript": "^5.9.3"
54
+ "vite": "^7.1",
55
+ "@types/webpack": "^5.28",
56
+ "vite-plugin-dts": "^4.5",
57
+ "vitest": "^4.0",
58
+ "typescript": "^5.9"
59
59
  },
60
60
  "scripts": {
61
61
  "lint": "eslint",