@devup-ui/webpack-plugin 1.0.44 → 1.0.45

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/loader.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("node:fs/promises"),s=require("node:path"),e=require("@devup-ui/wasm");let M=!1;const j=function(g){const{watch:o,package:w,cssDir:l,sheetFile:S,classMapFile:v,fileMapFile:C,singleCss:P,theme:c,defaultClassMap:n,defaultFileMap:u,defaultSheet:p}=this.getOptions(),a=this.async(),f=this.resourcePath;M||(M=!0,u&&e.importFileMap(u),n&&e.importClassMap(n),p&&e.importSheet(p),c&&e.registerTheme(c));try{let t=s.relative(s.dirname(f),l).replaceAll("\\","/");const b=s.relative(process.cwd(),f);t.startsWith("./")||(t=`./${t}`);const{code:h,css:y="",map:d,cssFile:m,updatedBaseStyle:$}=e.codeExtract(b,g.toString(),w,t,P,!1,!0),F=d?JSON.parse(d):null,r=[];if($&&r.push(i.writeFile(s.join(l,"devup-ui.css"),e.getCss(null,!1),"utf-8")),m){const x=`${this.resourcePath} ${Date.now()}`;r.push(i.writeFile(s.join(l,s.basename(m)),o?`/* ${x} */`:y)),o&&r.push(i.writeFile(S,e.exportSheet()),i.writeFile(v,e.exportClassMap()),i.writeFile(C,e.exportFileMap())),Promise.all(r).catch(console.error).finally(()=>a(null,h,F));return}a(null,h,F)}catch(t){a(t)}};exports.default=j;
package/dist/loader.d.ts CHANGED
@@ -8,6 +8,9 @@ export interface DevupUILoaderOptions {
8
8
  watch: boolean;
9
9
  singleCss: boolean;
10
10
  theme?: object;
11
+ defaultSheet: object;
12
+ defaultClassMap: object;
13
+ defaultFileMap: object;
11
14
  }
12
15
  declare const devupUILoader: RawLoaderDefinitionFunction<DevupUILoaderOptions>;
13
16
  export default devupUILoader;
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAcA,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;IAElB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;CACvB;AAGD,QAAA,MAAM,aAAa,EAAE,2BAA2B,CAAC,oBAAoB,CAgFlE,CAAA;AACH,eAAe,aAAa,CAAA"}
package/dist/loader.js CHANGED
@@ -1,61 +1,62 @@
1
1
  import { writeFile as t } from "node:fs/promises";
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) {
2
+ import { relative as d, dirname as k, join as M, basename as D } from "node:path";
3
+ import { importFileMap as O, importClassMap as j, importSheet as A, registerTheme as B, codeExtract as E, getCss as I, exportSheet as J, exportClassMap as L, exportFileMap as N } from "@devup-ui/wasm";
4
+ let F = !1;
5
+ const q = function(g) {
6
6
  const {
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));
7
+ watch: r,
8
+ package: C,
9
+ cssDir: a,
10
+ sheetFile: S,
11
+ classMapFile: x,
12
+ fileMapFile: P,
13
+ singleCss: v,
14
+ theme: l,
15
+ defaultClassMap: o,
16
+ defaultFileMap: c,
17
+ defaultSheet: p
18
+ } = this.getOptions(), i = this.async(), n = this.resourcePath;
19
+ F || (F = !0, c && O(c), o && j(o), p && A(p), l && B(l));
17
20
  try {
18
- let e = $(b(this.resourcePath), r).replaceAll(
19
- "\\",
20
- "/"
21
- );
21
+ let e = d(k(n), a).replaceAll("\\", "/");
22
+ const w = d(process.cwd(), n);
22
23
  e.startsWith("./") || (e = `./${e}`);
23
24
  const {
24
- code: o,
25
- css: P = "",
26
- map: c,
27
- cssFile: n,
28
- updatedBaseStyle: y
29
- } = w(
30
- M,
31
- f.toString(),
32
- m,
25
+ code: u,
26
+ css: y = "",
27
+ map: f,
28
+ cssFile: h,
29
+ updatedBaseStyle: $
30
+ } = E(
31
+ w,
32
+ g.toString(),
33
+ C,
33
34
  e,
34
- x,
35
+ v,
35
36
  !1,
36
37
  !0
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()}`;
38
+ ), m = f ? JSON.parse(f) : null, s = [];
39
+ if ($ && s.push(
40
+ t(M(a, "devup-ui.css"), I(null, !1), "utf-8")
41
+ ), h) {
42
+ const b = `${this.resourcePath} ${Date.now()}`;
42
43
  s.push(
43
44
  t(
44
- u(r, k(n)),
45
- i ? `/* ${S} */` : P
45
+ M(a, D(h)),
46
+ r ? `/* ${b} */` : y
46
47
  )
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));
48
+ ), r && s.push(
49
+ t(S, J()),
50
+ t(x, L()),
51
+ t(P, N())
52
+ ), Promise.all(s).catch(console.error).finally(() => i(null, u, m));
52
53
  return;
53
54
  }
54
- a(null, o, p);
55
+ i(null, u, m);
55
56
  } catch (e) {
56
- a(e);
57
+ i(e);
57
58
  }
58
59
  };
59
60
  export {
60
- I as default
61
+ q as default
61
62
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "webpack"
19
19
  ],
20
20
  "type": "module",
21
- "version": "1.0.44",
21
+ "version": "1.0.45",
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.43"
48
+ "@devup-ui/wasm": "1.0.44"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@devup-ui/wasm": "*"